Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoggerHook ¶
func NewTracingHook ¶
func NewTracingHook() pg.QueryHook
Types ¶
type Config ¶
type Config struct { // 数据库驱动 Driver string `json:"driver,omitempty"` // 数据库连接 Source string `json:"source,omitempty"` ConnMaxLifetimeSeconds int64 `json:"conn_max_lifetime_seconds,omitempty"` MaxOpenConns int32 `json:"max_open_conns,omitempty"` MinIdleConns int32 `json:"min_idle_conns,omitempty"` MaxRetries int32 `json:"max_retries,omitempty"` }
Config 数据库配置
func (*Config) GetConnMaxLifetimeSeconds ¶
func (*Config) GetMaxOpenConns ¶
func (*Config) GetMaxRetries ¶
func (*Config) GetMinIdleConns ¶
type Option ¶
type Option func(*options)
func WithApplicationName ¶
WithApplicationName 设置applicationName
func WithCollection ¶
WithCollection 设置migrations的collection
Click to show internal directories.
Click to hide internal directories.