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

Method SelectContext

named_context.go:96–104  ·  view source on GitHub ↗

SelectContext using this NamedStmt Any named placeholder parameters are replaced with fields from arg.

(ctx context.Context, dest interface{}, arg interface{})

Source from the content-addressed store, hash-verified

94// SelectContext using this NamedStmt
95// Any named placeholder parameters are replaced with fields from arg.
96func (n *NamedStmt) SelectContext(ctx context.Context, dest interface{}, arg interface{}) error {
97 rows, err := n.QueryxContext(ctx, arg)
98 if err != nil {
99 return err
100 }
101 // if something happens here, we want to make sure the rows are Closed
102 defer rows.Close()
103 return scanAll(rows, dest, false)
104}
105
106// GetContext using this NamedStmt
107// Any named placeholder parameters are replaced with fields from arg.

Callers 1

TestNamedContextQueriesFunction · 0.95

Calls 3

QueryxContextMethod · 0.95
scanAllFunction · 0.85
CloseMethod · 0.65

Tested by 1

TestNamedContextQueriesFunction · 0.76