Versions in this module Expand all Collapse all v1 v1.1.0 Apr 30, 2022 Changes in this version type Config + SingularTable bool + TablePrefix string type ConfigOption + func WithSingularTable(singularTable bool) ConfigOption + func WithTablePrefix(tablePrefix string) ConfigOption v1.0.0 Dec 24, 2020 Changes in this version + func Close() + func Deregister() + func DeregisterByKey(key string) + func GetDB() *gorm.DB + func GetDBByKey(key string) *gorm.DB + func MockDB() (*sql.DB, sqlmock.Sqlmock) + func MockDBByKey(key string) (*sql.DB, sqlmock.Sqlmock) + func Register(config *Config) + func RegisterByKey(config *Config, key string) + func SetLogger(db *gorm.DB, logger logger.Interface) + type Config struct + ConnMaxLifetime time.Duration + Connection *ConnectionConfig + LogLevel logger.LogLevel + MaxIdleConns int + MaxOpenConns int + func NewConfig(user, pwd, host, port, dbname, charset string, logLevel logger.LogLevel, ...) *Config + func (c *Config) GenDSN() string + type ConfigOption interface + func WithConnMaxLifetime(connMaxLifetime time.Duration) ConfigOption + func WithMaxIdleConns(maxIdleConns int) ConfigOption + func WithMaxOpenConns(maxOpenConns int) ConfigOption + type ConnectionConfig struct + Charset string + DBName string + Host string + Loc string + ParseTime bool + Port string + Pwd string + User string + type Model struct + CreatedAt int64 + ID int64 + UpdatedAt int64