Versions in this module Expand all Collapse all v2 v2.0.3 Sep 22, 2023 v2.0.2 Sep 20, 2023 v2.0.1 Aug 2, 2023 v2.0.0 Jun 27, 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{}) Other modules containing this package github.com/keepchen/go-sail