MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestHighBitHashInsertIntoBigint

Function TestHighBitHashInsertIntoBigint

server/querylog_test.go:185–214  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

183}
184
185func TestQueryLoggerStopIsIdempotent(t *testing.T) {
186 db, err := sql.Open("duckdb", ":memory:")
187 if err != nil {
188 t.Fatalf("open duckdb: %v", err)
189 }
190
191 ql := &QueryLogger{
192 db: db,
193 cfg: QueryLogConfig{
194 BatchSize: 1,
195 FlushInterval: time.Hour,
196 },
197 ch: make(chan QueryLogEntry, 1),
198 done: make(chan struct{}),
199 }
200
201 go ql.flushLoop()
202
203 ql.Stop()
204 ql.Stop()
205}
206
207func TestHighBitHashInsertIntoBigint(t *testing.T) {
208 db, err := sql.Open("duckdb", ":memory:")
209 if err != nil {
210 t.Fatalf("open duckdb: %v", err)
211 }
212 defer func() { _ = db.Close() }()
213
214 _, err = db.Exec("CREATE TABLE test_hash (h BIGINT)")
215 if err != nil {
216 t.Fatalf("create table: %v", err)
217 }

Callers

nothing calls this directly

Calls 4

CloseMethod · 0.65
ExecMethod · 0.65
ScanMethod · 0.65
OpenMethod · 0.45

Tested by

no test coverage detected