Documentation
¶
Index ¶
- func Register(path string)
- type Configuration
- type Db
- func (p *Db) Commit(fn func(_ *sql.Tx) error) (err error)
- func (p *Db) Exec(query string, args ...interface{}) (sql.Result, error)
- func (p *Db) ExecT(tx *sql.Tx, query string, args ...interface{}) (sql.Result, error)
- func (p *Db) Get(query string, args ...interface{}) *sql.Row
- func (p *Db) GetT(tx *sql.Tx, query string, args ...interface{}) *sql.Row
- func (p *Db) Migrate() error
- func (p *Db) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (p *Db) Rollback() error
- func (p *Db) Status(w io.Writer)
- type Migration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct {
Driver string `toml:"driver"`
Host string `toml:"host"`
Port int `toml:"port"`
User string `toml:"user"`
Password string `toml:"password"`
Name string `toml:"name"`
MaxOpen int `toml:"max_open"`
MaxIdle int `toml:"max_idle"`
Extra map[string]interface{} `toml:"extra"`
}
func (*Configuration) Backup ¶
func (p *Configuration) Backup() (string, []string)
func (*Configuration) Connect ¶
func (p *Configuration) Connect() (string, []string)
func (*Configuration) Create ¶
func (p *Configuration) Create() (string, []string)
func (*Configuration) Drop ¶
func (p *Configuration) Drop() (string, []string)
func (*Configuration) Load ¶
func (p *Configuration) Load(env string) error
func (*Configuration) Source ¶
func (p *Configuration) Source() string
Click to show internal directories.
Click to hide internal directories.