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

Function TestTranspile_OtherSetNotQuerySource

transpiler/query_source_test.go:67–81  ·  view source on GitHub ↗

TestTranspile_OtherDuckgresParamNotIntercepted guards the interception scope: only duckgres.query_source is handled here. Another duckgres.* SET is not silently swallowed by the query_source path (QuerySourceSet stays nil).

(t *testing.T)

Source from the content-addressed store, hash-verified

65 "garbage": "SET duckgres.query_source = 'garbage'",
66 "10KB string": "SET duckgres.query_source = '" + longJunk + "'",
67 "unicode + control chars": "SET duckgres.query_source = e'caf\\u00e9\\n\\ttab'",
68 "integer constant": "SET duckgres.query_source = 123",
69 "boolean constant": "SET duckgres.query_source = true",
70 "multiple values": "SET duckgres.query_source = 'standard', 'endpoints'",
71 "set local garbage": "SET LOCAL duckgres.query_source = 'garbage'",
72 }
73 for name, in := range inputs {
74 t.Run(name, func(t *testing.T) {
75 result, err := tr.Transpile(in)
76 if err != nil {
77 t.Fatalf("Transpile(%.80q) error: %v", in, err)
78 }
79 if result.Error == nil {
80 got := "<nil>"
81 if result.QuerySourceSet != nil {
82 got = *result.QuerySourceSet
83 }
84 t.Fatalf("Transpile(%.80q): Error = nil, want 22023 rejection (QuerySourceSet=%.80q)", in, got)

Callers

nothing calls this directly

Calls 3

TranspileMethod · 0.80
NewFunction · 0.70
DefaultConfigFunction · 0.70

Tested by

no test coverage detected