modulepackage
0.0.7
Repository: https://github.com/golang-tools/sqlhelper.git
Documentation: pkg.go.dev
# README
sqlhelper
uptrace/bun
的代理对象,用于解决对pg,mysql和sqlite3的连接问题
本项目使用bun而不是xorm或者gorm这些老牌的项目主要是因为:
- bun对postgresql有更好的支持
- 使用标准库
database/sql
的接口定义 - 文档更好些
注意:请使用v0.0.5以上的版本
# Functions
New 创建一个新的数据库客户端代理.
No description provided by the author
SetPool 设置连接池信息.
WithConnMaxIdleTimeMS 设置连接池的最大空闲连接超时时间,单位ms.
WithConnMaxLifetimeMS 设置连接池的最大连接超时时间,单位ms.
WithDiscardUnknownColumns 设置当有未知列时不报错.
No description provided by the author
WithLogger 用于添加logger方便debug.
WithMaxIdleConns 设置连接池的最大空闲连接数.
WithMaxOpenConns 设置连接池的最大连接数.
WithParallelCallback 设置初始化后回调并行执行而非串行执行.
WithQueryTimeoutMS 设置最大请求超时,单位ms.
WithURL 使用要连接的数据库管理系统的url.
# Variables
DB 默认的数据库代理对象.
No description provided by the author
ErrProxyAllreadySettedUniversalClient 代理已经设置过redis客户端对象.
ErrProxyNotYetSettedUniversalClient 代理还未设置客户端对象.
ErrUnknownClientType 未知的redis客户端类型.
ErrUnSupportSchema 未支持的数据库管理服务类型.
# Interfaces
Option configures how we set up the connection.
# Type aliases
Callback redis操作的回调函数.