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

Method SQLFor

tests/perf/core/intent_matcher.go:14–29  ·  view source on GitHub ↗
(query Query, protocol Protocol)

Source from the content-addressed store, hash-verified

12}
13
14func (m *IntentMatcher) SQLFor(query Query, protocol Protocol) (string, error) {
15 switch protocol {
16 case ProtocolPGWire, ProtocolPGWireUncached, ProtocolPGWireCached, ProtocolTrino, ProtocolTrinoCached:
17 if strings.TrimSpace(query.CanonicalSQL()) == "" {
18 return "", fmt.Errorf("query %s missing canonical SQL", query.QueryID)
19 }
20 return query.CanonicalSQL(), nil
21 default:
22 return "", fmt.Errorf("unknown protocol %q", protocol)
23 }
24}

Calls

no outgoing calls