Versions in this module Expand all Collapse all v0 v0.0.3 Jul 21, 2021 v0.0.2 Jun 10, 2021 Changes in this version + const MysqlCharsetUTF8MB4 + const TypeMysql + const TypePostgres + const TypeSqlite + func Default() *gorm.DB + func New(config Config) (db *gorm.DB, err error) + type Config struct + Gorm GormConfig + MysqlConfig MysqlConfig + PostgresConfig PostgresConfig + Sqlite SqliteConfig + Type string + type GormConfig struct + SingularTable bool + TablePrefix string + type Model struct + CreatedAt time.Time + UUID string + UpdatedAt time.Time + func (m *Model) BeforeCreate(tx *gorm.DB) error + type MysqlConfig struct + Charset string + DBName string + Host string + ParseTime bool + Password string + Port int + TimeZone string + User string + func (c MysqlConfig) Datasource() (string, error) + func (c MysqlConfig) Validate() error + type PostgresConfig struct + DBName string + Host string + Password string + Port int + SSLMode string + TimeZone string + User string + func (c PostgresConfig) Datasource() (string, error) + func (c PostgresConfig) Validate() error + type SqliteConfig struct + Filepath string + func (c SqliteConfig) Datasource() (string, error)