Versions in this module Expand all Collapse all v1 v1.0.2 Apr 7, 2023 v1.0.1 Apr 7, 2023 v1.0.0 Apr 7, 2023 Changes in this version + var DefaultMysqlConfig = &MysqlConfig + var DefaultPgConfig = &PgConfig + func CreateDatabase(db *gorm.DB, dbname string) error + func DropDatabase(db *gorm.DB, dbname string) error + func DropTables(db *gorm.DB, tables ...string) error + func HasDatabase(db *gorm.DB, dbname string) (bool, error) + func HasTable(db *gorm.DB, table string) (bool, error) + func ScopeOrderByCreatedAtDesc(db *gorm.DB) *gorm.DB + func ScopeOrderByUpdatedAtDesc(db *gorm.DB) *gorm.DB + type Model struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + Id int + UpdatedAt time.Time + type Mysql struct + func NewMysql(cfg *MysqlConfig) *Mysql + func (m *Mysql) DB(args ...string) *gorm.DB + func (m *Mysql) Open(args ...string) *gorm.DB + type MysqlConfig struct + Addr string + Dbname string + Password string + User string + type Pg struct + func NewPg(cfg *PgConfig) *Pg + func (p *Pg) DB(args ...string) *gorm.DB + func (p *Pg) Open(args ...string) *gorm.DB + type PgConfig struct + Dbname string + Host string + Password string + Port int + Tz string + User string + type RelateModel struct + CreatedAt time.Time + Id int + UpdatedAt time.Time + type Scope = func(db *gorm.DB) *gorm.DB + func ScopePagination(page, pageSize int) Scope