Versions in this module Expand all Collapse all v1 v1.3.0 Jul 1, 2019 v1.2.0 Mar 17, 2018 Changes in this version + const DATABASE_DIR + const DBCONFIG_FILE + const DEFAULTDB_NAME + func Callback(fn func(DbOrTx) error, tx ...*sqlx.Tx) error + func CallbackByName(dbName string, fn func(DbOrTx) error, tx ...*sqlx.Tx) error + func DB(name ...string) (*sqlx.DB, bool) + func List() map[string]*sqlx.DB + func MustDB(name ...string) *sqlx.DB + func TransactCallback(fn func(*sqlx.Tx) error, tx ...*sqlx.Tx) (err error) + func TransactCallbackByName(dbName string, fn func(*sqlx.Tx) error, tx ...*sqlx.Tx) (err error) + type DBConfig struct + ColumnSnake bool + Connstring string + Driver string + Enable bool + MaxIdleConns int + MaxOpenConns int + Name string + StructTag string + func Config(name ...string) (DBConfig, bool) + func MustConfig(name ...string) DBConfig + type DBService struct + Default *sqlx.DB + List map[string]*sqlx.DB + type DbOrTx interface + BindNamed func(query string, arg interface{}) (string, []interface{}, error) + DriverName func() string + Exec func(query string, args ...interface{}) (sql.Result, error) + Get func(dest interface{}, query string, args ...interface{}) error + MustExec func(query string, args ...interface{}) sql.Result + NamedExec func(query string, arg interface{}) (sql.Result, error) + NamedQuery func(query string, arg interface{}) (*sqlx.Rows, error) + Prepare func(query string) (*sql.Stmt, error) + PrepareNamed func(query string) (*sqlx.NamedStmt, error) + Preparex func(query string) (*sqlx.Stmt, error) + Query func(query string, args ...interface{}) (*sql.Rows, error) + QueryRow func(query string, args ...interface{}) *sql.Row + QueryRowx func(query string, args ...interface{}) *sqlx.Row + Queryx func(query string, args ...interface{}) (*sqlx.Rows, error) + Rebind func(query string) string + Select func(dest interface{}, query string, args ...interface{}) error