Documentation ¶
Index ¶
- Constants
- func GetMySQLDB(mysqlConfig *config.MysqlConfig) (*sql.DB, error)
- func GetOrmDB(mysqlConfig *config.MysqlConfig) (*gorm.DB, error)
- type MySQLPool
- func (this *MySQLPool) Close()
- func (this *MySQLPool) DecrNumOpen()
- func (this *MySQLPool) Get() (*sql.DB, error)
- func (this *MySQLPool) IncrNumOpen()
- func (this *MySQLPool) MaxOpen() int64
- func (this *MySQLPool) MinOpen() int64
- func (this *MySQLPool) NumOpen() int64
- func (this *MySQLPool) Release(db *sql.DB) error
- func (this *MySQLPool) SetMaxOpen(maxOpen int64) error
Constants ¶
View Source
const ( DB_CONFIG_USERNAME = "root" DB_CONFIG_PASSWORD = "" DB_CONFIG_HOST = "127.0.0.1" DB_CONFIG_PORT = 3306 DB_CONFIG_CHARSET = "utf8mb4" DB_CONFIG_TIMEOUT = 10 )
View Source
const ( MYSQL_POOL_MIN_OPEN = 1 MYSQL_POOL_MAX_OPEN = 1 MYSQL_POOL_MAX_OPEN_LIMIT = 1000 )
Variables ¶
This section is empty.
Functions ¶
func GetMySQLDB ¶
func GetMySQLDB(mysqlConfig *config.MysqlConfig) (*sql.DB, error)
Types ¶
type MySQLPool ¶
func (*MySQLPool) DecrNumOpen ¶
func (this *MySQLPool) DecrNumOpen()
func (*MySQLPool) IncrNumOpen ¶
func (this *MySQLPool) IncrNumOpen()
Click to show internal directories.
Click to hide internal directories.