Documentation ¶
Index ¶
- type SqlConnPool
- func (p *SqlConnPool) Begin() (*SqlConnTransaction, error)
- func (p *SqlConnPool) Close() error
- func (p *SqlConnPool) Delete(deleteStr string, args ...interface{}) (int64, error)
- func (p *SqlConnPool) Insert(insertStr string, args ...interface{}) (int64, error)
- func (p *SqlConnPool) InsertMap(table string, m map[string]interface{}) (int64, error)
- func (p *SqlConnPool) InsertMapList(table string, ms []map[string]interface{}) (int64, error)
- func (p *SqlConnPool) Query(queryStr string, args ...interface{}) ([]map[string]interface{}, error)
- func (p *SqlConnPool) QueryPage(page *utils.PageTable, args ...interface{}) (*utils.PageData, error)
- func (p *SqlConnPool) Tx(f func(tx *SqlConnTransaction), errFunc func(err error)) error
- func (p *SqlConnPool) Update(updateStr string, args ...interface{}) (int64, error)
- type SqlConnTransaction
- func (t *SqlConnTransaction) Commit() error
- func (t *SqlConnTransaction) Delete(deleteStr string, args ...interface{}) (int64, error)
- func (t *SqlConnTransaction) Insert(insertStr string, args ...interface{}) (int64, error)
- func (t *SqlConnTransaction) InsertMap(table string, m map[string]interface{}) (int64, error)
- func (t *SqlConnTransaction) InsertMapList(table string, ms []map[string]interface{}) (int64, error)
- func (t *SqlConnTransaction) Query(queryStr string, args ...interface{}) ([]map[string]interface{}, error)
- func (t *SqlConnTransaction) Rollback() error
- func (t *SqlConnTransaction) Tx(f func(tx *SqlConnTransaction), errFunc func(err error)) error
- func (t *SqlConnTransaction) Update(updateStr string, args ...interface{}) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SqlConnPool ¶
type SqlConnPool struct { DriverName string DataSourceName string MaxOpenConns int64 MaxIdleConns int64 SqlDB *sql.DB // 连接池 }
var (
DB *SqlConnPool
)
func (*SqlConnPool) Close ¶
func (p *SqlConnPool) Close() error
func (*SqlConnPool) Delete ¶
func (p *SqlConnPool) Delete(deleteStr string, args ...interface{}) (int64, error)
func (*SqlConnPool) Insert ¶
func (p *SqlConnPool) Insert(insertStr string, args ...interface{}) (int64, error)
func (*SqlConnPool) InsertMap ¶
func (p *SqlConnPool) InsertMap(table string, m map[string]interface{}) (int64, error)
func (*SqlConnPool) InsertMapList ¶
func (p *SqlConnPool) InsertMapList(table string, ms []map[string]interface{}) (int64, error)
func (*SqlConnPool) Query ¶
func (p *SqlConnPool) Query(queryStr string, args ...interface{}) ([]map[string]interface{}, error)
func (*SqlConnPool) Tx ¶
func (p *SqlConnPool) Tx(f func(tx *SqlConnTransaction), errFunc func(err error)) error
type SqlConnTransaction ¶
func (*SqlConnTransaction) Commit ¶
func (t *SqlConnTransaction) Commit() error
func (*SqlConnTransaction) Delete ¶
func (t *SqlConnTransaction) Delete(deleteStr string, args ...interface{}) (int64, error)
func (*SqlConnTransaction) Insert ¶
func (t *SqlConnTransaction) Insert(insertStr string, args ...interface{}) (int64, error)
func (*SqlConnTransaction) InsertMap ¶
func (t *SqlConnTransaction) InsertMap(table string, m map[string]interface{}) (int64, error)
func (*SqlConnTransaction) InsertMapList ¶
func (t *SqlConnTransaction) InsertMapList(table string, ms []map[string]interface{}) (int64, error)
func (*SqlConnTransaction) Query ¶
func (t *SqlConnTransaction) Query(queryStr string, args ...interface{}) ([]map[string]interface{}, error)
func (*SqlConnTransaction) Tx ¶
func (t *SqlConnTransaction) Tx(f func(tx *SqlConnTransaction), errFunc func(err error)) error
Click to show internal directories.
Click to hide internal directories.