package
module
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Apr 23, 2020
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 4
Opens a new window with list of known importers.
README
¶
Documentation
¶
Package sqlxx extends github.com/jmoiron/sqlx.
-
func ToSnake(s string) string
-
type Ctx
-
type DB
-
func (db *DB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
-
func (db *DB) NamedGetContext(ctx Ctx, dest interface{}, query string, arg interface{}) error
-
func (db *DB) NamedIn(queryIn string, arg interface{}) (query string, args []interface{}, err error)
-
func (db *DB) NamedSelectContext(ctx Ctx, dest interface{}, query string, arg interface{}) error
-
type Tx
ToSnake maps from CamelCase to snake_case.
Ctx is a synonym for convenience.
DB is a wrapper around sqlx.DB.
NewDB returns a new sqlxx DB wrapper for a pre-existing *sqlx.DB.
BeginTxx begins a transaction and returns an *sqlxx.Tx instead of an *sqlx.Tx.
func (db *DB) NamedGetContext(ctx Ctx, dest interface{}, query string, arg interface{}) error
NamedGetContext within a transaction and context.
Any named placeholder parameters are replaced with fields from arg.
func (db *DB) NamedIn(queryIn string, arg interface{}) (query string, args []interface{}, err error)
NamedIn expands slice values in arg returning the modified query string
and a new arg list that can be executed by a database.
func (db *DB) NamedSelectContext(ctx Ctx, dest interface{}, query string, arg interface{}) error
NamedSelectContext within a transaction and context.
Any named placeholder parameters are replaced with fields from arg.
Tx is an sqlxx wrapper around sqlx.Tx with extra functionality.
func (tx *Tx) NamedGetContext(ctx Ctx, dest interface{}, query string, arg interface{}) error
NamedGetContext within a transaction and context.
Any named placeholder parameters are replaced with fields from arg.
func (tx *Tx) NamedIn(queryIn string, arg interface{}) (query string, args []interface{}, err error)
NamedIn expands slice values in arg returning the modified query string
and a new arg list that can be executed by a database.
func (tx *Tx) NamedSelectContext(ctx Ctx, dest interface{}, query string, arg interface{}) error
NamedSelectContext within a transaction and context.
Any named placeholder parameters are replaced with fields from arg.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.