Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DriverMysql = Driver{"mysql", orm.DRMySQL}
View Source
var DriverOracle = Driver{"oracle", orm.DROracle}
View Source
var DriverPostgres = Driver{"postgres", orm.DRPostgres}
View Source
var DriverSqlite = Driver{"sqlite3", orm.DRSqlite}
View Source
var DriverTiDB = Driver{"tidb", orm.DRTiDB}
Functions ¶
func InitOrm ¶
func InitOrm(config BaseConfig) (err error)
Types ¶
type BaseConfig ¶
type BaseConfig struct {
// contains filtered or unexported fields
}
func (*BaseConfig) MaxConn ¶ added in v1.1.1
func (b *BaseConfig) MaxConn(n int)
func (*BaseConfig) MaxIdle ¶ added in v1.1.1
func (b *BaseConfig) MaxIdle(n int)
func (*BaseConfig) RegisterModel ¶
func (b *BaseConfig) RegisterModel(models ...interface{})
type MysqlConfig ¶
type MysqlConfig struct {
InitDb bool
AliasName string
UserName string
Password string
Host string
Port int
MaxIdle int
MaxConn int
DbName string
}
func (*MysqlConfig) Build ¶
func (c *MysqlConfig) Build() (b BaseConfig)
type OrmContext ¶
func New ¶ added in v1.1.0
func New() *OrmContext
func (*OrmContext) Transaction ¶
func (o *OrmContext) Transaction(h func(TxContext) error) (err error)
type PostgresConfig ¶
type PostgresConfig struct {
InitDb bool
AliasName string
UserName string
Password string
Host string
Port int
DbName string
MaxIdle int
MaxConn int
SSL string
}
func (*PostgresConfig) Build ¶
func (c *PostgresConfig) Build() (b BaseConfig)
type SqliteConfig ¶
func (*SqliteConfig) Build ¶
func (c *SqliteConfig) Build() (b BaseConfig)
Click to show internal directories.
Click to hide internal directories.