MCPcopy
hub / github.com/go-gorm/gorm / QueryContext

Method QueryContext

prepare_stmt.go:120–129  ·  view source on GitHub ↗
(ctx context.Context, query string, args ...interface{})

Source from the content-addressed store, hash-verified

118}
119
120func (db *PreparedStmtDB) QueryContext(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) {
121 stmt, err := db.prepare(ctx, db.ConnPool, false, query)
122 if err == nil {
123 rows, err = stmt.QueryContext(ctx, args...)
124 if errors.Is(err, driver.ErrBadConn) {
125 db.Stmts.Delete(query)
126 }
127 }
128 return rows, err
129}
130
131func (db *PreparedStmtDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
132 stmt, err := db.prepare(ctx, db.ConnPool, false, query)

Callers

nothing calls this directly

Calls 3

prepareMethod · 0.95
QueryContextMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected