Documentation ¶
Index ¶
- Variables
- func Migrate(l logger.ILog, con *mysql.Connection, changesets string) (*sqlx.DB, error)
- type DBW
- func (d *DBW) AffectedRows(result sql.Result) int
- func (d *DBW) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *DBW) Get(dest interface{}, query string, args ...interface{}) error
- func (d *DBW) Name() string
- func (d *DBW) QueryRowScan(dest interface{}, query string, args ...interface{}) error
- func (d *DBW) RecordExists(err error) (bool, error)
- func (d *DBW) RecordExistsString(err error, s string) (bool, string, error)
- func (d *DBW) Select(dest interface{}, query string, args ...interface{}) error
- func (d *DBW) SuppressNoRowsError(err error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoDatabase is when there is no database connection. ErrNoDatabase = errors.New("no database connection is set") )
Functions ¶
Types ¶
type DBW ¶
type DBW struct {
// contains filtered or unexported fields
}
DBW is a database wrapper that provides helpful utilities.
func (*DBW) AffectedRows ¶
AffectedRows returns the number of rows affected by the query.
func (*DBW) Exec ¶
Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.
func (*DBW) Get ¶
Get using this DB. Any placeholder parameters are replaced with supplied args. An error is returned if the result set is empty.
func (*DBW) QueryRowScan ¶
QueryRowScan returns a single result.
func (*DBW) RecordExists ¶
RecordExists returns if the record exists or not.
func (*DBW) RecordExistsString ¶
RecordExistsString returns the proper string is the record exists.
func (*DBW) Select ¶
Select using this DB. Any placeholder parameters are replaced with supplied args.
func (*DBW) SuppressNoRowsError ¶
SuppressNoRowsError will return nil if the error is sql.ErrNoRows.
Click to show internal directories.
Click to hide internal directories.