MCPcopy
hub / github.com/go-sql-driver/mysql / ExecContext

Method ExecContext

connection.go:653–665  ·  view source on GitHub ↗
(ctx context.Context, query string, args []driver.NamedValue)

Source from the content-addressed store, hash-verified

651}
652
653func (mc *mysqlConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) {
654 dargs, err := namedValueToValue(args)
655 if err != nil {
656 return nil, err
657 }
658
659 if err := mc.watchCancel(ctx); err != nil {
660 return nil, err
661 }
662 defer mc.finish()
663
664 return mc.Exec(query, dargs)
665}
666
667func (mc *mysqlConn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error) {
668 if err := mc.watchCancel(ctx); err != nil {

Callers 8

TestContextCancelExecFunction · 0.45
TestContextCancelBeginFunction · 0.45
TestContextBeginReadOnlyFunction · 0.45
benchmarkExecContextFunction · 0.45

Calls 4

watchCancelMethod · 0.95
finishMethod · 0.95
ExecMethod · 0.95
namedValueToValueFunction · 0.85

Tested by 8

TestContextCancelExecFunction · 0.36
TestContextCancelBeginFunction · 0.36
TestContextBeginReadOnlyFunction · 0.36
benchmarkExecContextFunction · 0.36