Versions in this module Expand all Collapse all v3 v3.0.4 May 29, 2024 v3.0.3 Mar 19, 2024 Changes in this version type Conf + Enable bool v3.0.2 Feb 20, 2024 v3.0.1 Jan 5, 2024 Changes in this version + func Init(conf Conf) v3.0.0 Oct 31, 2023 Changes in this version + const DriverNameClickhouse + const DriverNameMysql + const DriverNamePostgres + const DriverNameSqlite + const DriverNameSqlserver + func InitDB(conf Conf) + func New(conf Conf) (rInstance, wInstance *gorm.DB) + func NewFreshDB(conf Conf) (rInstance, wInstance *gorm.DB) + type ClickhouseConf struct + Read ClickhouseConfItem + Write ClickhouseConfItem + type ClickhouseConfItem struct + Database string + Host string + Password string + Port int + ReadTimeout int + Username string + WriteTimeout int + type Conf struct + AutoMigrate bool + Clickhouse ClickhouseConf + ConnectionPool ConnectionPoolConf + DriverName string + LogLevel string + Mysql MysqlConf + Postgres PostgresConf + Sqlite SqliteConf + Sqlserver SqlserverConf + func (conf Conf) GenDialector() (gorm.Dialector, gorm.Dialector) + type ConnectionPoolConf struct + ConnMaxIdleTimeMinutes int + ConnMaxLifeTimeMinutes int + MaxIdleConnCount int + MaxOpenConnCount int + type Instance struct + R *gorm.DB + W *gorm.DB + func GetInstance() *Instance + type MysqlConf struct + Read MysqlConfItem + Write MysqlConfItem + type MysqlConfItem struct + Charset string + Database string + Host string + Loc string + ParseTime bool + Password string + Port int + Username string + type PostgresConf struct + Read PostgresConfItem + Write PostgresConfItem + type PostgresConfItem struct + Database string + Host string + Password string + Port int + SSLMode string + TimeZone string + Username string + type SqliteConf struct + Read SqliteConfItem + Write SqliteConfItem + type SqliteConfItem struct + File string + type SqlserverConf struct + Read SqlserverConfItem + Write SqlserverConfItem + type SqlserverConfItem struct + Database string + Host string + Password string + Port int + Username string + type ZapLoggerForGorm struct + IgnoreRecordNotFoundError bool + LogLevel gormLogger.LogLevel + SkipCallerLookup bool + SlowThreshold time.Duration + ZapLogger *zap.Logger + func NewZapLoggerForGorm(zapLogger *zap.Logger, conf Conf) ZapLoggerForGorm + func (zg ZapLoggerForGorm) Error(_ context.Context, tpl string, v ...interface{}) + func (zg ZapLoggerForGorm) Info(_ context.Context, tpl string, v ...interface{}) + func (zg ZapLoggerForGorm) LogMode(level gormLogger.LogLevel) gormLogger.Interface + func (zg ZapLoggerForGorm) SetAsDefault() + func (zg ZapLoggerForGorm) Trace(_ context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), ...) + func (zg ZapLoggerForGorm) Warn(_ context.Context, tpl string, v ...interface{})