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

Function isEmptyFlightQuery

duckdbservice/flight_handler.go:1005–1013  ·  view source on GitHub ↗

isEmptyFlightQuery checks if a query is empty or contains only semicolons, whitespace, and/or comments. DuckDB rejects empty queries with SQLSTATE 42000, but PostgreSQL clients use these for pings (e.g., pgx sends "-- ping").

(query string)

Source from the content-addressed store, hash-verified

1003 if tx == nil && isTxControl && execErr == nil {
1004 session.releaseSQLTransactionDrain()
1005 }
1006 if execErr != nil {
1007 if closedErr := sessionClosedStatus(execErr); closedErr != nil {
1008 return 0, closedErr
1009 }
1010 return 0, status.Errorf(codes.InvalidArgument, "failed to execute update: %v", execErr)
1011 }
1012
1013 sendProfilingMetadataSince(ctx, execStartedAt)
1014
1015 affected, err := result.RowsAffected()
1016 if err != nil {

Callers 3

DoGetStatementMethod · 0.85

Calls 1

stripFlightCommentsFunction · 0.85

Tested by

no test coverage detected