Documentation ¶
Index ¶
- func Begin(db *sqlx.DB) (*sqlx.Tx, error)
- func Commit(tx *sqlx.Tx) error
- func IsEmptyResultDataError(err error) bool
- func NewEmptyResultDataError(err error) error
- func NullInt(i int) null.Int
- func Rollback(tx *sqlx.Tx) error
- type EmptyResultDataError
- type ParseRows
- type SqlxTpl
- func (s SqlxTpl) Get(dest interface{}, query string, args ...interface{}) error
- func (s SqlxTpl) NamedExec(query string, arg interface{}) (result sql.Result, err error)
- func (s SqlxTpl) NamedQuery(query string, arg interface{}, parse ParseRows) error
- func (s SqlxTpl) Queryx(query string, args []interface{}, parse ParseRows) error
- func (s SqlxTpl) Select(dest interface{}, query string, args ...interface{}) error
- func (s *SqlxTpl) TxDo(do func(tx *sqlx.Tx) error) error
- func (s SqlxTpl) TxNamedExec(tx *sqlx.Tx, query string, arg interface{}) (sql.Result, error)
- func (s SqlxTpl) UnsafeGet(dest interface{}, query string, args ...interface{}) error
- func (s SqlxTpl) UnsafeNamedQuery(query string, arg interface{}, parse ParseRows) error
- func (s SqlxTpl) UnsafeQueryx(query string, parse ParseRows, args ...interface{}) error
- func (s SqlxTpl) UnsafeSelect(dest interface{}, query string, args ...interface{}) error
- type TransactedSQL
- type TxSQLSetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsEmptyResultDataError ¶
IsEmptyResultDataError verifies if error is an EmptyResultDataError
func NewEmptyResultDataError ¶
NewEmptyResultDataError creates an EmptyResultDataError instance
Types ¶
type EmptyResultDataError ¶
EmptyResultDataError error type for an empty result database
type SqlxTpl ¶
type SqlxTpl struct { TransactedSQL DB *sqlx.DB }
SqlxTpl is a template for database queries
func (SqlxTpl) NamedExec ¶
NamedExec executes a namedexec query If a transaction is setted, the query runs over it
func (SqlxTpl) NamedQuery ¶
NamedQuery executes a safe named query
func (SqlxTpl) TxNamedExec ¶
TxNamedExec executes the query with a transaction
func (SqlxTpl) UnsafeNamedQuery ¶
UnsafeNamedQuery executes an unsafe named query
func (SqlxTpl) UnsafeQueryx ¶
UnsafeQueryx executes an unsafe query
func (SqlxTpl) UnsafeSelect ¶
UnsafeSelect executes an unsafe select
type TransactedSQL ¶
type TransactedSQL struct {
// contains filtered or unexported fields
}
TransactedSQL should be embedded on sql repositories
func (*TransactedSQL) SetTx ¶
func (t *TransactedSQL) SetTx(tx *sqlx.Tx)
SetTx sets the sql transaction
type TxSQLSetter ¶
TxSQLSetter interface for a struct that supports transaction