Documentation ¶
Index ¶
- func BatchInsert(m ConnInterface, batch *sql.Batch) (int64, error)
- func Delete(m ConnInterface, del *sql.Delete) (int64, error)
- func Exec(m ConnInterface, stament string) error
- func FetchAll(m ConnInterface, table string, where map[string]interface{}, t interface{}) ([]interface{}, error)
- func FetchAllByWhere(m ConnInterface, table string, where *sql.Where, t interface{}) ([]interface{}, error)
- func FetchPage(m ConnInterface, table string, where map[string]interface{}, t interface{}, ...) ([]interface{}, error)
- func FetchPageByWhere(m ConnInterface, table string, where *sql.Where, t interface{}, page int, ...) ([]interface{}, error)
- func FetchRow(m ConnInterface, table string, where map[string]interface{}, t interface{}) (interface{}, error)
- func Init(conf config.Mysql) error
- func Insert(m ConnInterface, insert *sql.Insert) (int64, error)
- func OpenDB(conf config.Mysql) (*sql.DB, error)
- func Query(m ConnInterface, query string, t interface{}, args ...interface{}) ([]interface{}, error)
- func Select(m ConnInterface, sel *sql.Select, t interface{}) ([]interface{}, error)
- func Update(m ConnInterface, update *sql.Update) (int64, error)
- type ConnInterface
- type DbInterface
- type Mysql
- func (m *Mysql) BatchInsert(batch *ds.Batch) (int64, error)
- func (m *Mysql) Begin() error
- func (m *Mysql) Commit() error
- func (m *Mysql) Delete(del *ds.Delete) (int64, error)
- func (m *Mysql) Exec(statement string) error
- func (m *Mysql) FetchAll(table string, where map[string]interface{}, t interface{}) ([]interface{}, error)
- func (m *Mysql) FetchAllByWhere(table string, where *ds.Where, t interface{}) ([]interface{}, error)
- func (m *Mysql) FetchPage(table string, where map[string]interface{}, t interface{}, page int, ...) ([]interface{}, error)
- func (m *Mysql) FetchPageByWhere(table string, where *ds.Where, t interface{}, page int, pageSize int) ([]interface{}, error)
- func (m *Mysql) FetchRow(table string, where map[string]interface{}, t interface{}) (interface{}, error)
- func (m *Mysql) InTransaction() bool
- func (m *Mysql) Insert(insert *ds.Insert) (int64, error)
- func (m *Mysql) Query(query string, t interface{}, args ...interface{}) ([]interface{}, error)
- func (m *Mysql) RollBack() error
- func (m *Mysql) Select(sel *ds.Select, t interface{}) ([]interface{}, error)
- func (m *Mysql) Update(update *ds.Update) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchInsert ¶ added in v0.0.3
func BatchInsert(m ConnInterface, batch *sql.Batch) (int64, error)
func Exec ¶ added in v0.0.3
func Exec(m ConnInterface, stament string) error
func FetchAll ¶ added in v0.0.3
func FetchAll(m ConnInterface, table string, where map[string]interface{}, t interface{}) ([]interface{}, error)
func FetchAllByWhere ¶ added in v0.0.6
func FetchAllByWhere(m ConnInterface, table string, where *sql.Where, t interface{}) ([]interface{}, error)
func FetchPageByWhere ¶ added in v0.0.6
func FetchRow ¶ added in v0.0.3
func FetchRow(m ConnInterface, table string, where map[string]interface{}, t interface{}) (interface{}, error)
func Query ¶ added in v0.0.3
func Query(m ConnInterface, query string, t interface{}, args ...interface{}) ([]interface{}, error)
Types ¶
type ConnInterface ¶ added in v0.0.3
type DbInterface ¶ added in v0.0.3
type DbInterface interface { Begin() error Commit() error RollBack() error InTransaction() bool Query(string, interface{}, ...interface{}) ([]interface{}, error) Exec(string) error Insert(*sql.Insert) (int64, error) Update(*sql.Update) (int64, error) Delete(*sql.Delete) (int64, error) BatchInsert(*sql.Batch) (int64, error) Select(*sql.Select, interface{}) ([]interface{}, error) FetchRow(string, map[string]interface{}, interface{}) (interface{}, error) FetchAll(string, map[string]interface{}, interface{}) ([]interface{}, error) FetchAllByWhere(string, *sql.Where, interface{}) ([]interface{}, error) FetchPage(string, map[string]interface{}, interface{}, int, int) ([]interface{}, error) FetchPageByWhere(string, *sql.Where, interface{}, int, int) ([]interface{}, error) }
type Mysql ¶
type Mysql struct {
// contains filtered or unexported fields
}
func NewSharding ¶ added in v0.0.2
func (*Mysql) FetchAllByWhere ¶ added in v0.0.6
func (*Mysql) FetchPageByWhere ¶ added in v0.0.6
func (*Mysql) InTransaction ¶
Click to show internal directories.
Click to hide internal directories.