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

Function TestSessionReset

tests/integration/session_test.go:290–315  ·  view source on GitHub ↗

TestSessionReset tests RESET command

(t *testing.T)

Source from the content-addressed store, hash-verified

288
289// TestSessionReset tests RESET command
290func TestSessionReset(t *testing.T) {
291 db := testHarness.DuckgresDB
292
293 // Save original search_path — RESET search_path passes through to DuckDB
294 // and would reset to DuckDB default (just "main"), losing the ducklake prefix
295 var originalPath string
296 if err := db.QueryRow("SHOW search_path").Scan(&originalPath); err != nil {
297 t.Fatalf("SHOW search_path (before) failed: %v", err)
298 }
299 t.Cleanup(func() {
300 _, _ = db.Exec("SET search_path TO '" + originalPath + "'")
301 })
302 tests := []QueryTest{
303 {
304 Name: "reset_search_path",
305 Query: "RESET search_path",
306 DuckgresOnly: true,
307 },
308 {
309 Name: "reset_all",
310 Query: "RESET ALL",
311 DuckgresOnly: true,
312 },
313 }
314 runQueryTests(t, tests)
315}
316
317// TestSessionCurrentFunctions tests current_* functions
318func TestSessionCurrentFunctions(t *testing.T) {

Callers

nothing calls this directly

Calls 3

runQueryTestsFunction · 0.85
ScanMethod · 0.65
ExecMethod · 0.65

Tested by

no test coverage detected