Documentation
¶
Index ¶
Constants ¶
View Source
const ( DBTypeSQLite3 = "sqlite3" DBTypeMySQL = "mysql" // TODO )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface {
Init(dbname string, cfg *viper.Viper, logger *zap.Logger) error
Close()
InitTables(ctsqls, cisqls []string) error
Count(table string, where []Where) (int, error)
Insert(table string, feilds []Feild) (sql.Result, error)
Replace(table string, feilds []Feild) (sql.Result, error) // insert or replace
Delete(table string, where []Where) (sql.Result, error)
Update(table string, toupdate []Feild, where []Where) (sql.Result, error)
SelectRows(table string, where []Where, order *Order, paging *Paging, result interface{}) error
SelectRowsOffset(table string, where []Where, order *Order, offset, limit uint64, result interface{}) error
Begin() error
Commit() error
Rollback() error
}
Database interface for app database-operation
Click to show internal directories.
Click to hide internal directories.