Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFoundConnectionPool error = errors.New("connection pool config is nil")
)
Functions ¶
This section is empty.
Types ¶
type ConnectionPoolConfig ¶
type Driver ¶
type MysqlConfig ¶
type MysqlConfig struct {
// 数据库用户名
Username string
// 数据库密码
Password string
// 数据库地址
Host string
// 数据库端口
Port string
// 数据库名称
Database string
// 是否开启ssl加密
SSL bool
// 连接池配置
ConnectionPool *ConnectionPoolConfig
//字符串编码-大多数时候不需要手动配置
Charset string
}
mysql的驱动配置
func (*MysqlConfig) ConnectionPoolConfig ¶
func (c *MysqlConfig) ConnectionPoolConfig() *ConnectionPoolConfig
获取连接池配置对象
type NewOption ¶
func WithDriverWithDefaultMode ¶
func WithDriverWithDefaultMode[T any](config UniversalConfig) NewOption[T]
使用单节点驱动
type TransactionCallBack ¶
执行的回调函数 返回的err为nil时,事务提交,否则回滚
type UniversalConfig ¶
type UniversalConfig interface {
// 构建dsn
BuildDsn() string
//获取连接池配置对象
ConnectionPoolConfig() *ConnectionPoolConfig
}
Click to show internal directories.
Click to hide internal directories.