MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / ExecContext

Method ExecContext

client/conn.go:276–297  ·  view source on GitHub ↗

ExecContext implements the driver.ExecerContext.ExecContext method.

(ctx context.Context, query string, args []driver.NamedValue)

Source from the content-addressed store, hash-verified

274
275// ExecContext implements the driver.ExecerContext.ExecContext method.
276func (c *conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (result driver.Result, err error) {
277 defer trace.StartRegion(ctx, "dbExec").End()
278
279 if atomic.LoadInt32(&c.closed) != 0 {
280 err = driver.ErrBadConn
281 return
282 }
283
284 // TODO(xq262144): make use of the ctx argument
285 sq := convertQuery(query, args)
286
287 var affectedRows, lastInsertID int64
288 if affectedRows, lastInsertID, _, err = c.addQuery(ctx, types.WriteQuery, sq); err != nil {
289 return
290 }
291
292 result = &execResult{
293 affectedRows: affectedRows,
294 lastInsertID: lastInsertID,
295 }
296 return
297}
298
299// QueryContext implements the driver.QueryerContext.QueryContext method.
300func (c *conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (rows driver.Rows, err error) {

Callers

nothing calls this directly

Calls 4

addQueryMethod · 0.95
StartRegionFunction · 0.92
convertQueryFunction · 0.85
EndMethod · 0.45

Tested by

no test coverage detected