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

Method QueryContext

connection.go:687–704  ·  view source on GitHub ↗
(ctx context.Context, args []driver.NamedValue)

Source from the content-addressed store, hash-verified

685}
686
687func (stmt *mysqlStmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) {
688 dargs, err := namedValueToValue(args)
689 if err != nil {
690 return nil, err
691 }
692
693 if err := stmt.mc.watchCancel(ctx); err != nil {
694 return nil, err
695 }
696
697 rows, err := stmt.query(dargs)
698 if err != nil {
699 stmt.mc.finish()
700 return nil, err
701 }
702 rows.finish = stmt.mc.finish
703 return rows, err
704}
705
706func (stmt *mysqlStmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {
707 dargs, err := namedValueToValue(args)

Callers

nothing calls this directly

Calls 4

queryMethod · 0.95
namedValueToValueFunction · 0.85
watchCancelMethod · 0.80
finishMethod · 0.80

Tested by

no test coverage detected