Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration interface { GetDefaultMySQLConfigs() *MySQLConfig GetCustomMySQLConfigs(database string, host string, username string, password string) *MySQLConfig }
func New ¶ added in v1.0.5
func New(env environment.Environment) Configuration
type MySQLConfig ¶
type MySQLService ¶
type MySQLService interface { Create(value interface{}) (tx *gorm.DB) CreateInBatches(value interface{}, batchSize int) (tx *gorm.DB) Save(value interface{}) (tx *gorm.DB) First(dest interface{}, conds ...interface{}) (tx *gorm.DB) Take(dest interface{}, conds ...interface{}) (tx *gorm.DB) Last(dest interface{}, conds ...interface{}) (tx *gorm.DB) Find(dest interface{}, conds ...interface{}) (tx *gorm.DB) FindInBatches(dest interface{}, batchSize int, fc func(tx *gorm.DB, batch int) error) *gorm.DB FirstOrInit(dest interface{}, conds ...interface{}) (tx *gorm.DB) FirstOrCreate(dest interface{}, conds ...interface{}) (tx *gorm.DB) Update(column string, value interface{}) (tx *gorm.DB) Updates(values interface{}) (tx *gorm.DB) UpdateColumn(column string, value interface{}) (tx *gorm.DB) UpdateColumns(values interface{}) (tx *gorm.DB) Delete(value interface{}, conds ...interface{}) (tx *gorm.DB) Count(count *int64) (tx *gorm.DB) Row() *sql.Row Rows() (*sql.Rows, error) Scan(dest interface{}) (tx *gorm.DB) Pluck(column string, dest interface{}) (tx *gorm.DB) ScanRows(rows *sql.Rows, dest interface{}) error Connection(fc func(tx *gorm.DB) error) (err error) Transaction(fc func(tx *gorm.DB) error, opts ...*sql.TxOptions) (err error) Begin(opts ...*sql.TxOptions) *gorm.DB Commit() *gorm.DB Rollback() *gorm.DB SavePoint(name string) *gorm.DB RollbackTo(name string) *gorm.DB Exec(sql string, values ...interface{}) (tx *gorm.DB) }
func NewMySQLService ¶
func NewMySQLService(config dbConfig) (MySQLService, error)
func NewMySQLServiceByDSN ¶ added in v1.0.2
func NewMySQLServiceByDSN(dsn string) (MySQLService, error)
Click to show internal directories.
Click to hide internal directories.