Versions in this module Expand all Collapse all v1 v1.2.1 Jan 8, 2020 Changes in this version + const AT + const DOLLAR + const NAMED + const QUESTION + const UNKNOWN + var NameMapper = strings.ToLower + func BindNamed(bindType int, query string, arg interface{}) (string, []interface{}, error) + func BindType(driverName string) int + func Get(q Queryer, dest interface{}, query string, args ...interface{}) error + func GetContext(ctx context.Context, q QueryerContext, dest interface{}, query string, ...) error + func In(query string, args ...interface{}) (string, []interface{}, error) + func LoadFile(e Execer, path string) (*sql.Result, error) + func LoadFileContext(ctx context.Context, e ExecerContext, path string) (*sql.Result, error) + func MapScan(r ColScanner, dest map[string]interface{}) error + func MustExec(e Execer, query string, args ...interface{}) sql.Result + func MustExecContext(ctx context.Context, e ExecerContext, query string, args ...interface{}) sql.Result + func Named(query string, arg interface{}) (string, []interface{}, error) + func NamedExec(e Ext, query string, arg interface{}) (sql.Result, error) + func NamedExecContext(ctx context.Context, e ExtContext, query string, arg interface{}) (sql.Result, error) + func Rebind(bindType int, query string) string + func Select(q Queryer, dest interface{}, query string, args ...interface{}) error + func SelectContext(ctx context.Context, q QueryerContext, dest interface{}, query string, ...) error + func SliceScan(r ColScanner) ([]interface{}, error) + func StructScan(rows rowsi, dest interface{}) error + type ColScanner interface + Columns func() ([]string, error) + Err func() error + Scan func(dest ...interface{}) error + type DB struct + Mapper *reflectx.Mapper + func Connect(driverName, dataSourceName string) (*DB, error) + func ConnectContext(ctx context.Context, driverName, dataSourceName string) (*DB, error) + func MustConnect(driverName, dataSourceName string) *DB + func MustOpen(driverName, dataSourceName string) *DB + func NewDb(db *sql.DB, driverName string) *DB + func Open(driverName, dataSourceName string) (*DB, error) + func (db *DB) BeginTxx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) + func (db *DB) Beginx() (*Tx, error) + func (db *DB) BindNamed(query string, arg interface{}) (string, []interface{}, error) + func (db *DB) DriverName() string + func (db *DB) Get(dest interface{}, query string, args ...interface{}) error + func (db *DB) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (db *DB) MapperFunc(mf func(string) string) + func (db *DB) MustBegin() *Tx + func (db *DB) MustBeginTx(ctx context.Context, opts *sql.TxOptions) *Tx + func (db *DB) MustExec(query string, args ...interface{}) sql.Result + func (db *DB) MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result + func (db *DB) NamedExec(query string, arg interface{}) (sql.Result, error) + func (db *DB) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) + func (db *DB) NamedQuery(query string, arg interface{}) (*Rows, error) + func (db *DB) NamedQueryContext(ctx context.Context, query string, arg interface{}) (*Rows, error) + func (db *DB) PrepareNamed(query string) (*NamedStmt, error) + func (db *DB) PrepareNamedContext(ctx context.Context, query string) (*NamedStmt, error) + func (db *DB) Preparex(query string) (*Stmt, error) + func (db *DB) PreparexContext(ctx context.Context, query string) (*Stmt, error) + func (db *DB) QueryRowx(query string, args ...interface{}) *Row + func (db *DB) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *Row + func (db *DB) Queryx(query string, args ...interface{}) (*Rows, error) + func (db *DB) QueryxContext(ctx context.Context, query string, args ...interface{}) (*Rows, error) + func (db *DB) Rebind(query string) string + func (db *DB) Select(dest interface{}, query string, args ...interface{}) error + func (db *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (db *DB) Unsafe() *DB + type Execer interface + Exec func(query string, args ...interface{}) (sql.Result, error) + type ExecerContext interface + ExecContext func(ctx context.Context, query string, args ...interface{}) (sql.Result, error) + type Ext interface + type ExtContext interface + type NamedStmt struct + Params []string + QueryString string + Stmt *Stmt + func (n *NamedStmt) Close() error + func (n *NamedStmt) Exec(arg interface{}) (sql.Result, error) + func (n *NamedStmt) ExecContext(ctx context.Context, arg interface{}) (sql.Result, error) + func (n *NamedStmt) Get(dest interface{}, arg interface{}) error + func (n *NamedStmt) GetContext(ctx context.Context, dest interface{}, arg interface{}) error + func (n *NamedStmt) MustExec(arg interface{}) sql.Result + func (n *NamedStmt) MustExecContext(ctx context.Context, arg interface{}) sql.Result + func (n *NamedStmt) Query(arg interface{}) (*sql.Rows, error) + func (n *NamedStmt) QueryContext(ctx context.Context, arg interface{}) (*sql.Rows, error) + func (n *NamedStmt) QueryRow(arg interface{}) *Row + func (n *NamedStmt) QueryRowContext(ctx context.Context, arg interface{}) *Row + func (n *NamedStmt) QueryRowx(arg interface{}) *Row + func (n *NamedStmt) QueryRowxContext(ctx context.Context, arg interface{}) *Row + func (n *NamedStmt) Queryx(arg interface{}) (*Rows, error) + func (n *NamedStmt) QueryxContext(ctx context.Context, arg interface{}) (*Rows, error) + func (n *NamedStmt) Select(dest interface{}, arg interface{}) error + func (n *NamedStmt) SelectContext(ctx context.Context, dest interface{}, arg interface{}) error + func (n *NamedStmt) Unsafe() *NamedStmt + type Preparer interface + Prepare func(query string) (*sql.Stmt, error) + type PreparerContext interface + PrepareContext func(ctx context.Context, query string) (*sql.Stmt, error) + type Queryer interface + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryRowx func(query string, args ...interface{}) *Row + Queryx func(query string, args ...interface{}) (*Rows, error) + type QueryerContext interface + QueryContext func(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error) + QueryRowxContext func(ctx context.Context, query string, args ...interface{}) *Row + QueryxContext func(ctx context.Context, query string, args ...interface{}) (*Rows, error) + type Row struct + Mapper *reflectx.Mapper + func (r *Row) ColumnTypes() ([]*sql.ColumnType, error) + func (r *Row) Columns() ([]string, error) + func (r *Row) Err() error + func (r *Row) MapScan(dest map[string]interface{}) error + func (r *Row) Scan(dest ...interface{}) error + func (r *Row) SliceScan() ([]interface{}, error) + func (r *Row) StructScan(dest interface{}) error + type Rows struct + Mapper *reflectx.Mapper + func NamedQuery(e Ext, query string, arg interface{}) (*Rows, error) + func NamedQueryContext(ctx context.Context, e ExtContext, query string, arg interface{}) (*Rows, error) + func (r *Rows) MapScan(dest map[string]interface{}) error + func (r *Rows) SliceScan() ([]interface{}, error) + func (r *Rows) StructScan(dest interface{}) error + type Stmt struct + Mapper *reflectx.Mapper + func Preparex(p Preparer, query string) (*Stmt, error) + func PreparexContext(ctx context.Context, p PreparerContext, query string) (*Stmt, error) + func (s *Stmt) Get(dest interface{}, args ...interface{}) error + func (s *Stmt) GetContext(ctx context.Context, dest interface{}, args ...interface{}) error + func (s *Stmt) MustExec(args ...interface{}) sql.Result + func (s *Stmt) MustExecContext(ctx context.Context, args ...interface{}) sql.Result + func (s *Stmt) QueryRowx(args ...interface{}) *Row + func (s *Stmt) QueryRowxContext(ctx context.Context, args ...interface{}) *Row + func (s *Stmt) Queryx(args ...interface{}) (*Rows, error) + func (s *Stmt) QueryxContext(ctx context.Context, args ...interface{}) (*Rows, error) + func (s *Stmt) Select(dest interface{}, args ...interface{}) error + func (s *Stmt) SelectContext(ctx context.Context, dest interface{}, args ...interface{}) error + func (s *Stmt) Unsafe() *Stmt + type Tx struct + Mapper *reflectx.Mapper + func (tx *Tx) BindNamed(query string, arg interface{}) (string, []interface{}, error) + func (tx *Tx) DriverName() string + func (tx *Tx) Get(dest interface{}, query string, args ...interface{}) error + func (tx *Tx) GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (tx *Tx) MustExec(query string, args ...interface{}) sql.Result + func (tx *Tx) MustExecContext(ctx context.Context, query string, args ...interface{}) sql.Result + func (tx *Tx) NamedExec(query string, arg interface{}) (sql.Result, error) + func (tx *Tx) NamedExecContext(ctx context.Context, query string, arg interface{}) (sql.Result, error) + func (tx *Tx) NamedQuery(query string, arg interface{}) (*Rows, error) + func (tx *Tx) NamedStmt(stmt *NamedStmt) *NamedStmt + func (tx *Tx) NamedStmtContext(ctx context.Context, stmt *NamedStmt) *NamedStmt + func (tx *Tx) PrepareNamed(query string) (*NamedStmt, error) + func (tx *Tx) PrepareNamedContext(ctx context.Context, query string) (*NamedStmt, error) + func (tx *Tx) Preparex(query string) (*Stmt, error) + func (tx *Tx) PreparexContext(ctx context.Context, query string) (*Stmt, error) + func (tx *Tx) QueryRowx(query string, args ...interface{}) *Row + func (tx *Tx) QueryRowxContext(ctx context.Context, query string, args ...interface{}) *Row + func (tx *Tx) Queryx(query string, args ...interface{}) (*Rows, error) + func (tx *Tx) QueryxContext(ctx context.Context, query string, args ...interface{}) (*Rows, error) + func (tx *Tx) Rebind(query string) string + func (tx *Tx) Select(dest interface{}, query string, args ...interface{}) error + func (tx *Tx) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error + func (tx *Tx) Stmtx(stmt interface{}) *Stmt + func (tx *Tx) StmtxContext(ctx context.Context, stmt interface{}) *Stmt + func (tx *Tx) Unsafe() *Tx