Documentation ¶
Index ¶
- Constants
- type MySQL
- func (m *MySQL) Builder() *builder.Sqlbuilder
- func (m *MySQL) Close() error
- func (m *MySQL) DB() *sqlx.DB
- func (m *MySQL) Drop() error
- func (m *MySQL) Dump(path, filename string) error
- func (m *MySQL) Exists() error
- func (m *MySQL) Install() error
- func (m *MySQL) Schema() string
- func (m *MySQL) Tables() ([]string, error)
Constants ¶
const ( MaxIdleConns = 5 MaxOpenConns = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQL ¶
type MySQL struct {
// contains filtered or unexported fields
}
mysql defines the implementation of the MySQL.Driver if MySQL is selected as the main driver.
func Setup ¶
func Setup(env *environment.Env) (*MySQL, error)
Setup
New - Creates a new MySQL instance and returns a new database driver. Returns errors.INVALID if there was an error establishing a connection or pinging.
func (*MySQL) Builder ¶
func (m *MySQL) Builder() *builder.Sqlbuilder
Builder
Returns a new query builder instance.
func (*MySQL) Drop ¶
Drop
Drop deletes the database with the environments database name. Returns errors.INTERNAL if the exec command could not be ran.
func (*MySQL) Dump ¶
Dump
Dump the database to file with the given path and file name. Returns errors.INTERNAL if the connection, dump failed.
func (*MySQL) Exists ¶
Exists
CheckExists check's if the database exists. Returns errors.INVALID if the database was not found.