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

Method QueryContext

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

Source from the content-addressed store, hash-verified

179}
180
181func (tx *PreparedStmtTX) QueryContext(ctx context.Context, query string, args ...interface{}) (rows *sql.Rows, err error) {
182 stmt, err := tx.PreparedStmtDB.prepare(ctx, tx.Tx, true, query)
183 if err == nil {
184 rows, err = tx.Tx.StmtContext(ctx, stmt.Stmt).QueryContext(ctx, args...)
185 if errors.Is(err, driver.ErrBadConn) {
186 tx.PreparedStmtDB.Stmts.Delete(query)
187 }
188 }
189 return rows, err
190}
191
192func (tx *PreparedStmtTX) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row {
193 stmt, err := tx.PreparedStmtDB.prepare(ctx, tx.Tx, true, query)

Callers

nothing calls this directly

Calls 4

prepareMethod · 0.80
StmtContextMethod · 0.80
QueryContextMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected