Documentation ¶
Index ¶
- func NewMySQL(opts ...Option) (*sql.DB, *gorm.DB, bool, error)
- type DB
- func (m *DB) Close() error
- func (m *DB) DeleteByPK(table string, pk M) (int64, error)
- func (m *DB) DeleteByPKWithTran(tran *gorp.Transaction, table string, pk M) (int64, error)
- func (m *DB) DeleteSQL(table string, pk M) (string, []interface{})
- func (m *DB) In(query string, args ...interface{}) (string, []interface{}, error)
- func (m *DB) InsertM(table string, info M) (int64, error)
- func (m *DB) InsertMWithTran(tran *gorp.Transaction, table string, info M) (int64, error)
- func (m *DB) InsertSQL(table string, info M) (string, []interface{})
- func (m *DB) UpdateByPK(table string, pk, info M) (int64, error)
- func (m *DB) UpdateByPKWithTran(tran *gorp.Transaction, table string, pk, info M) (int64, error)
- func (m *DB) UpdateSQL(table string, pk, info M) (string, []interface{})
- type M
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
*gorp.DbMap
}
DB 数据库
func (*DB) DeleteByPKWithTran ¶
DeleteByPKWithTran 使用事物删除表数据
func (*DB) InsertMWithTran ¶
InsertMWithTran 使用事物插入数据
func (*DB) UpdateByPK ¶
UpdateByPK 更新表数据
func (*DB) UpdateByPKWithTran ¶
UpdateByPKWithTran 使用事物更新表数据
type Option ¶
type Option func(*options)
Option 配置项
func SetMaxLifetime ¶
SetMaxLifetime 设置连接可以被重新使用的最大时间量
func SetMaxOpenConns ¶
SetMaxOpenConns 设置打开连接到数据库的最大数量
Click to show internal directories.
Click to hide internal directories.