Documentation
¶
Index ¶
- Constants
- type Config
- type Database
- func (db *Database) Close() error
- func (db *Database) Connect() error
- func (db *Database) ConnectWithGormConfig(gormCfg gorm.Config) error
- func (db *Database) Ctx() *gorm.DB
- func (db *Database) MigrateDatabase(tables []interface{}) error
- func (db *Database) Reconnect() error
- func (db *Database) SqlDB() *sql.DB
- type Model
- type Preload
- type Where
Constants ¶
View Source
const ( DriverMSSQL = "mssql" DriverMySQL = "mysql" DriverSQLLite = "sqlite3" DriverPostgres = "postgres" DefaultMySQLCharset = "utf8mb4" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewWithConfig ¶
func (*Database) ConnectWithGormConfig ¶
func (*Database) MigrateDatabase ¶
type Model ¶
type Model struct {
Seq int64 `json:"seq" gorm:"primary_key;auto_increment:false;"`
Uid uuid.UUID `json:"uid" gorm:"primary_key;index"`
CreatedAt time.Time `json:"created_at" gorm:"index"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}
Model struct
Click to show internal directories.
Click to hide internal directories.