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

Method ComQuery

server/doltgres_handler.go:220–237  ·  view source on GitHub ↗

ComQuery implements the Handler interface.

(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, callback func(*sql.Context, *Result) error)

Source from the content-addressed store, hash-verified

218
219// ComQuery implements the Handler interface.
220func (h *DoltgresHandler) ComQuery(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, callback func(*sql.Context, *Result) error) error {
221 // TODO: This technically isn't query start and underestimates query execution time
222 start := time.Now()
223 if h.sel != nil {
224 h.sel.QueryStarted()
225 }
226
227 err := h.doQuery(ctx, c, query, parsed, nil, h.executeQuery, callback, nil)
228 if err != nil {
229 err = sql.CastSQLError(err)
230 }
231
232 if h.sel != nil {
233 h.sel.QueryCompleted(err == nil, time.Since(start))
234 }
235
236 return err
237}
238
239// ComResetConnection implements the Handler interface.
240func (h *DoltgresHandler) ComResetConnection(c *mysql.Conn) error {

Callers

nothing calls this directly

Calls 1

doQueryMethod · 0.95

Tested by

no test coverage detected