Versions in this module Expand all Collapse all v1 v1.0.0 Oct 25, 2023 Changes in this version + const MYSQL + const PG + func NewMysqlUrl(c DbConfig) string + func NewMysqlUrl2(c DbConfig) string + func NewPqUrl(c DbConfig) string + type DbConfig struct + Host string + Name string + Pass string + Port string + Prefix string + SslMode string + User string + type MyDb struct + Client *xorm.Engine + Config MyDbConfig + func NewDb(config MyDbConfig) (*MyDb, error) + 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 struct + Debug bool + DebugToFile bool + DebugToFileName string + DriverName string + MaxIdle int + MaxOpen int