MCPcopy
hub / github.com/jmoiron/sqlx / PreparexContext

Method PreparexContext

sqlx_context.go:155–157  ·  view source on GitHub ↗

PreparexContext returns an sqlx.Stmt instead of a sql.Stmt. The provided context is used for the preparation of the statement, not for the execution of the statement.

(ctx context.Context, query string)

Source from the content-addressed store, hash-verified

153// The provided context is used for the preparation of the statement, not for
154// the execution of the statement.
155func (db *DB) PreparexContext(ctx context.Context, query string) (*Stmt, error) {
156 return PreparexContext(ctx, db, query)
157}
158
159// QueryxContext queries the database and returns an *sqlx.Rows.
160// Any placeholder parameters are replaced with supplied args.

Callers 2

TestUsageContextFunction · 0.45
TestConnFunction · 0.45

Calls 1

PreparexContextFunction · 0.85

Tested by 2

TestUsageContextFunction · 0.36
TestConnFunction · 0.36