Documentation ¶
Index ¶
- Constants
- func NewMysqlUrl(c DbConfig) string
- func NewMysqlUrl2(c DbConfig) string
- func NewPqUrl(c DbConfig) string
- type DbConfig
- type MyDb
- func (db *MyDb) CreateTables(beanOrTableName interface{}) error
- func (db *MyDb) Delete(bean interface{}) (int64, error)
- func (db *MyDb) DropTables(beans ...interface{}) error
- func (db *MyDb) Insert(beans ...interface{}) (int64, error)
- func (db *MyDb) InsertOne(beans interface{}) (int64, error)
- func (db *MyDb) IsTableExist(beanOrTableName interface{}) (bool, error)
- func (db *MyDb) SetConnMaxLifetime(lifeTime time.Duration)
- func (db *MyDb) Update(bean interface{}, condiBean ...interface{}) (int64, error)
- type MyDbConfig
Constants ¶
View Source
const ( PG = "postgres" MYSQL = "mysql" )
Variables ¶
This section is empty.
Functions ¶
func NewMysqlUrl ¶
func NewMysqlUrl2 ¶
Types ¶
type MyDb ¶
type MyDb struct { Config MyDbConfig Client *xorm.Engine }
func NewDb ¶
func NewDb(config MyDbConfig) (*MyDb, error)
func (*MyDb) CreateTables ¶
func (*MyDb) DropTables ¶
func (*MyDb) IsTableExist ¶
func (*MyDb) SetConnMaxLifetime ¶
Click to show internal directories.
Click to hide internal directories.