Versions in this module Expand all Collapse all v1 v1.0.1 Feb 8, 2024 v1.0.0 Feb 8, 2024 Changes in this version + func GetTableName(object interface{}) string + func InitMysql(dsn string, opts ...Option) (*gorm.DB, error) + func InitPostgresql(dsn string, opts ...Option) (*gorm.DB, error) + func InitTidb(dsn string, opts ...Option) (*gorm.DB, error) + func NewCustomGormLogger(o *options) logger.Interface + type KV = map[string]interface + type Model struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint64 + UpdatedAt time.Time + type Model2 struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint64 + UpdatedAt time.Time + type Option func(*options) + func WithConnMaxLifetime(t time.Duration) Option + func WithEnableForeignKey() Option + func WithEnableTrace() Option + func WithGormPlugin(plugins ...gorm.Plugin) Option + func WithLogRequestIDKey(key string) Option + func WithLogging(l *zap.Logger, level ...logger.LogLevel) Option + func WithMaxIdleConns(size int) Option + func WithMaxOpenConns(size int) Option + func WithRWSeparation(slavesDsn []string, mastersDsn ...string) Option + func WithSlowThreshold(d time.Duration) Option