ComQuery implements the Handler interface.
(ctx context.Context, c *mysql.Conn, query string, parsed sqlparser.Statement, callback func(*sql.Context, *Result) error)
| 218 | |
| 219 | // ComQuery implements the Handler interface. |
| 220 | func (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. |
| 240 | func (h *DoltgresHandler) ComResetConnection(c *mysql.Conn) error { |