(query Query, protocol Protocol)
| 12 | } |
| 13 | |
| 14 | func (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 | } |
no outgoing calls