Documentation ¶
Overview ¶
Package sqlxext - provides handy extensions to sqlx default functions.
Index ¶
- func ExecSQLForRows(ctx context.Context, db sqlx.ExtContext, dest interface{}, query string, ...) error
- func NamedGetContext(ctx context.Context, db sqlx.ExtContext, dest interface{}, query string, ...) error
- func NamedSelectContext(ctx context.Context, db sqlx.ExtContext, dest interface{}, query string, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecSQLForRows ¶
func ExecSQLForRows( ctx context.Context, db sqlx.ExtContext, dest interface{}, query string, inParams interface{}, ) error
ExecSQLForRows execute db request and write results to dest. It is sqlx.SelectContext under the hood, but accepts query with named parameters. Nil dest or nil inParams are allowed. If dest is nil, it works like sqlx.NamedExecContext.
func NamedGetContext ¶
func NamedGetContext( ctx context.Context, db sqlx.ExtContext, dest interface{}, query string, inParams interface{}, ) error
NamedGetContext gets and scans one row it to dst like sqlx.GetContext does, but accepts query with named parameters. Nil inParams is allowed, unlike dest. Use ExecSQLForRows (NamedSelectContext) if you need to discard row(-s) or Exec the statement.
func NamedSelectContext ¶
func NamedSelectContext( ctx context.Context, db sqlx.ExtContext, dest interface{}, query string, inParams interface{}, ) error
NamedSelectContext select all rows and scans them to dst like sqlx.SelectContext does, but accepts query with named parameters. Nil dest or nil inParams are allowed. If dest is nil, it works like sqlx.NamedExecContext.
Types ¶
This section is empty.