Documentation ¶
Overview ¶
Package sqlxdb contains an sqlx implementation of the sqldb package
Index ¶
- type Connection
- type Queryable
- func (db *Queryable) Exec(query string, args ...interface{}) (rowsAffected int64, err error)
- func (db *Queryable) Get(dest interface{}, query string, args ...interface{}) error
- func (db *Queryable) NamedExec(query string, arg interface{}) (rowAffected int64, err error)
- func (db *Queryable) NamedGet(dest interface{}, query string, args interface{}) error
- func (db *Queryable) NamedSelect(dest interface{}, query string, args interface{}) error
- func (db *Queryable) Select(dest interface{}, query string, args ...interface{}) error
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { *Queryable // contains filtered or unexported fields }
Connection represents the sqlx implementation of the sqldb.Connection interface
func NewUnsafe ¶
func NewUnsafe(driverName, dsn string) (*Connection, error)
NewUnsafe returns a new SQLX connection that will succeed scanning when one or more columns in a SQL result have no corresponding fields in the destination struct.
func (*Connection) Beginx ¶
func (db *Connection) Beginx() (sqldb.Tx, error)
Beginx is an Exec that accepts named params (ex where id=:user_id)
func (*Connection) DSN ¶
func (db *Connection) DSN() string
DSN returns the DSN used to create the connection
type Queryable ¶
type Queryable struct {
// contains filtered or unexported fields
}
Queryable represents the sqlx implementation of the Queryable interface
func NewQueryable ¶
func NewQueryable(con sqlxQueryable) *Queryable
NewQueryable creates a new Queryable
func (*Queryable) Get ¶
Get is used to retrieve a single row An error (sql.ErrNoRows) is returned if the result set is empty.
func (*Queryable) NamedSelect ¶
NamedSelect is a Select() that accepts named params (ex where id=:user_id)