Versions in this module Expand all Collapse all v0 v0.0.1 May 30, 2022 Changes in this version + func NewDb(cfg *ModuleConfig, log *GormLogger) (*gorm.DB, error) + type GormLogger struct + func NewGormLogger(cfg *ModuleConfig, logger application.Logger) *GormLogger + func (g GormLogger) LogMode(level logger.LogLevel) logger.Interface + func (g GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error) + type ModuleConfig struct + func NewModuleConfig() *ModuleConfig + func (s *ModuleConfig) InitConfig(config application.Config) error + func (s *ModuleConfig) ProvidedServices() []interface{} + func (s *ModuleConfig) SetConnMaxLifetime(connMaxLifetime time.Duration) + func (s *ModuleConfig) SetHost(host string) + func (s *ModuleConfig) SetLoggingEnabled(loggingEnabled bool) + func (s *ModuleConfig) SetMaxIdleConns(maxIdleConns int) + func (s *ModuleConfig) SetMaxOpenConns(maxOpenConns int) + func (s *ModuleConfig) SetName(name string) + func (s *ModuleConfig) SetPass(pass string) + func (s *ModuleConfig) SetPort(port int) + func (s *ModuleConfig) SetPreferSimpleProtocol(preferSimpleProtocol bool) + func (s *ModuleConfig) SetSlowQueryLimit(slowQueryLimit int) + func (s *ModuleConfig) SetSslMode(sslMode string) + func (s *ModuleConfig) SetUser(user string)