Documentation ¶
Index ¶
- Variables
- func ChkExec(res sql.Result, err error, want int64, info string) error
- func ChkExecDiffError(res sql.Result, err, diffErr error, want int64) error
- func ChkQueryRow(err error) (bool, error)
- func InClause(column string, num, start int) string
- type Db
- func (d *Db) Close()
- func (d *Db) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *Db) OpenTransaction() (*DbTx, error)
- func (d *Db) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d *Db) QueryRow(query string, args ...interface{}) *sql.Row
- func (d *Db) Transactional(callback TxFunc, args ...interface{}) error
- type DbTx
- func (t *DbTx) Commit() error
- func (t *DbTx) ConvertError(err error) error
- func (t *DbTx) Discard()
- func (t *DbTx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (t *DbTx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (t *DbTx) QueryRow(query string, args ...interface{}) *sql.Row
- type SqlStorage
- type TxFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTxConflict = errors.New("Transaction conflict") ErrNoRows = errors.New("No matching rows in the database") )
Functions ¶
func ChkExecDiffError ¶
Similar to ChkExec() but returns the given "diff error" when the number of rows affected is different from the desired number. This allows the caller to distinguish between the error cases.
func ChkQueryRow ¶
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
func (*Db) OpenTransaction ¶
func (*Db) Transactional ¶
type DbTx ¶
type DbTx struct {
// contains filtered or unexported fields
}
func (*DbTx) ConvertError ¶
type SqlStorage ¶
Click to show internal directories.
Click to hide internal directories.