Documentation ¶
Overview ¶
the generic database file that defines the interface
the database actions for postgres
Index ¶
- func NewPostgres()
- type DB
- type Mysql
- func (db *Mysql) Create() error
- func (db *Mysql) Drop() error
- func (db *Mysql) Dump(exe *exec.Exec) (*io.ReadCloser, error)
- func (db *Mysql) DumpName() string
- func (db *Mysql) Impl() string
- func (db *Mysql) Name() string
- func (db *Mysql) Open() error
- func (db *Mysql) Restore(reader *bufio.Reader) error
- type Postgres
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶ added in v0.5.0
type DB interface { // open connection to database Open() error // create database Create() error // drop database Drop() error // dump the database with the command line utility Dump(exe *exec.Exec) (*io.ReadCloser, error) // restore the database using the database driver Restore(reader *bufio.Reader) error // return the implementation type Impl() string // return the name of the database Name() string // return the filename of the dump DumpName() string }
type Mysql ¶ added in v0.5.0
type Mysql struct {
// contains filtered or unexported fields
}
func NewMysql ¶ added in v0.5.0
func NewMysql(impl string, ip net.IPAddr, port uint16, user string, pass string, name string, maxConn int) *Mysql
instantiate a new mysql struct
type Postgres ¶ added in v0.5.0
type Postgres struct {
// contains filtered or unexported fields
}
func (*Postgres) Dump ¶ added in v0.5.0
func (db *Postgres) Dump()
dump the database and return the stdout stream
Click to show internal directories.
Click to hide internal directories.