Versions in this module Expand all Collapse all v1 v1.0.0 Jan 12, 2026 Changes in this version + func New(opts *Options) (*gorm.DB, error) + func NewPostgreSQL(opts *PostgreSQLOptions) (*gorm.DB, error) + func NewRedis(opts *RedisOptions) (*redis.Client, error) + type GormTracePlugin struct + func NewGormTracePlugin(enableTrace bool) *GormTracePlugin + func (op *GormTracePlugin) Initialize(db *gorm.DB) (err error) + func (op *GormTracePlugin) Name() string + type MySQLConfig struct + Charset string + Database string + EnableTrace bool + Enabled bool + Host string + Loc string + MaxConnections int + ParseTime bool + Password string + Port int + Timeout pkgConfig.Duration + Username string + func (c *MySQLConfig) DSN() string + func (c *MySQLConfig) ToOptions() (*Options, error) + func (c *MySQLConfig) Validate() error + type Options struct + Database string + EnableTrace bool + Host string + LogLevel logger.LogLevel + Logger logger.Interface + MaxConnectionLifeTime time.Duration + MaxIdleConnections int + MaxOpenConnections int + Password string + Username string + type PostgreSQLConfig struct + Database string + EnableTrace bool + Enabled bool + Host string + MaxConnections int + Password string + Port int + SSLMode string + Timeout pkgConfig.Duration + Username string + func (c *PostgreSQLConfig) TimeoutDuration() time.Duration + func (c *PostgreSQLConfig) ToOptions() (*PostgreSQLOptions, error) + func (c *PostgreSQLConfig) Validate() error + type PostgreSQLOptions struct + Database string + EnableTrace bool + Host string + LogLevel logger.LogLevel + Logger logger.Interface + MaxConnectionLifeTime time.Duration + MaxIdleConnections int + MaxOpenConnections int + Password string + Port int + SSLMode string + Username string + type RedisConfig struct + DB int + DialTimeout pkgConfig.Duration + EnableTrace bool + Enabled bool + Host string + IdleTimeout pkgConfig.Duration + MinIdleConns int + Password string + PoolSize int + Port int + ReadTimeout pkgConfig.Duration + WriteTimeout pkgConfig.Duration + func (c *RedisConfig) Addr() string + func (c *RedisConfig) DialTimeoutDuration() time.Duration + func (c *RedisConfig) IdleTimeoutDuration() time.Duration + func (c *RedisConfig) ReadTimeoutDuration() time.Duration + func (c *RedisConfig) ToOptions() (*RedisOptions, error) + func (c *RedisConfig) Validate() error + func (c *RedisConfig) WriteTimeoutDuration() time.Duration + type RedisOptions struct + Addr string + DB int + DialTimeout time.Duration + EnableTrace bool + IdleTimeout time.Duration + MinIdleConns int + Password string + PoolSize int + ReadTimeout time.Duration + WriteTimeout time.Duration