MCPcopy Create free account
hub / github.com/dolthub/doltgresql / query

Method query

server/connection_handler.go:1005–1019  ·  view source on GitHub ↗

query runs the given query and sends a CommandComplete message to the client

(query ConvertedQuery)

Source from the content-addressed store, hash-verified

1003
1004// query runs the given query and sends a CommandComplete message to the client
1005func (h *ConnectionHandler) query(query ConvertedQuery) error {
1006 // |rowsAffected| gets altered by the callback below
1007 rowsAffected := int32(0)
1008
1009 callback := h.spoolRowsCallback(query, &rowsAffected, false)
1010 err := h.doltgresHandler.ComQuery(context.Background(), h.mysqlConn, query.String, query.AST, callback)
1011 if err != nil {
1012 if strings.HasPrefix(err.Error(), "syntax error at position") {
1013 return errors.Errorf("This statement is not yet supported")
1014 }
1015 return err
1016 }
1017
1018 return h.send(makeCommandComplete(query.StatementTag, rowsAffected))
1019}
1020
1021// spoolRowsCallback returns a callback function that will send RowDescription message,
1022// then a DataRow message for each row in the result set.

Callers 2

handleQueryMethod · 0.95
handledPSQLCommandsMethod · 0.95

Calls 6

spoolRowsCallbackMethod · 0.95
sendMethod · 0.95
makeCommandCompleteFunction · 0.85
ComQueryMethod · 0.65
ErrorfMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected