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

Function PreparexContext

sqlx_context.go:69–75  ·  view source on GitHub ↗

PreparexContext prepares a statement. The provided context is used for the preparation of the statement, not for the execution of the statement.

(ctx context.Context, p PreparerContext, query string)

Source from the content-addressed store, hash-verified

67// The provided context is used for the preparation of the statement, not for
68// the execution of the statement.
69func PreparexContext(ctx context.Context, p PreparerContext, query string) (*Stmt, error) {
70 s, err := p.PrepareContext(ctx, query)
71 if err != nil {
72 return nil, err
73 }
74 return &Stmt{Stmt: s, unsafe: isUnsafe(p), Mapper: mapperFor(p)}, err
75}
76
77// GetContext does a QueryRow using the provided Queryer, and scans the
78// resulting row to dest. If dest is scannable, the result must only have one

Callers 4

PreparexContextMethod · 0.85
PreparexContextMethod · 0.85
PreparexContextMethod · 0.85
prepareNamedContextFunction · 0.85

Calls 3

isUnsafeFunction · 0.85
mapperForFunction · 0.85
PrepareContextMethod · 0.80

Tested by

no test coverage detected