Documentation ¶
Index ¶
- type Connection
- type DBW
- 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) QueryRowScan(dest interface{}, query string, args ...interface{}) error
- func (d *DBW) Select(dest interface{}, query string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { Username string `json:"Username" env:"DB_USERNAME"` Password string `json:"Password" env:"DB_PASSWORD"` Database string `json:"Database" env:"DB_DATABASE"` Charset string `json:"Charset" env:"DB_CHARSET"` Collation string `json:"Collation" env:"DB_COLLATION"` Hostname string `json:"Hostname" env:"DB_HOSTNAME"` Port int `json:"Port" env:"DB_PORT"` Parameter string `json:"Parameter" env:"DB_PARAMETER"` }
Connection holds the details for the MySQL connection.
type DBW ¶
type DBW struct {
// contains filtered or unexported fields
}
DBW is a database wrapper that provides helpful utilities.
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.
Click to show internal directories.
Click to hide internal directories.