Documentation ¶
Index ¶
- Constants
- type Mysql
- type MysqlExecutor
- func (m *MysqlExecutor) Delete(table string, idField string, id int) sql.Result
- func (m *MysqlExecutor) Deletes(table string, idField string, ids []int) sql.Result
- func (m *MysqlExecutor) Exec(query string, args ...interface{}) sql.Result
- func (m *MysqlExecutor) Get(result interface{}, table string, idField string, id interface{})
- func (m *MysqlExecutor) GetBy(result interface{}, table string, kvs map[string]interface{})
- func (m *MysqlExecutor) GetTable(result interface{}, id interface{})
- func (m *MysqlExecutor) Insert(obj interface{})
- func (m *MysqlExecutor) Inserts(list ...interface{})
- func (m *MysqlExecutor) List(result interface{}, table string, idField string, ids []int)
- func (m *MysqlExecutor) ListBy(result interface{}, table string, kvs map[string]interface{})
- func (m *MysqlExecutor) ListByStrIds(result interface{}, table string, idField string, ids []string)
- func (m *MysqlExecutor) Patch(table string, idField string, params interface{}) sql.Result
- func (m *MysqlExecutor) PatchArgs(table string, idField string, idValue interface{}, kvs ...interface{}) sql.Result
- func (m *MysqlExecutor) Select(result interface{}, query string, args ...interface{})
- func (m *MysqlExecutor) SelectFloat(query string, args ...interface{}) int64
- func (m *MysqlExecutor) SelectInt(query string, args ...interface{}) int64
- func (m *MysqlExecutor) SelectNullFloat(query string, args ...interface{}) null.Float
- func (m *MysqlExecutor) SelectNullInt(query string, args ...interface{}) null.Int
- func (m *MysqlExecutor) SelectNullStr(query string, args ...interface{}) null.String
- func (m *MysqlExecutor) SelectOne(result interface{}, query string, args ...interface{})
- func (m *MysqlExecutor) SelectStr(query string, args ...interface{}) string
- func (m *MysqlExecutor) Updates(list ...interface{}) int64
- func (m *MysqlExecutor) With(ctx context.Context)
- type Options
Constants ¶
View Source
const ( ErrorInit = 1 + iota ErrorQuery ErrorInsert ErrorUpdate ErrorDelete ErrorClose ErrorTxBegin ErrorTxCommit ErrorTxRollback )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mysql ¶
type Mysql struct { *MysqlExecutor DbMap *gorp.DbMap Transaction *gorp.Transaction // contains filtered or unexported fields }
func NewFromUrl ¶ added in v1.0.3
NewFromUrl mysqlUrl:root:6plzHiJKdUMlFZ@tcp(test.iqidao.com:43122)/good?charset=utf8mb4&MaxOpen=2000&MaxIdle=10&MaxLifetime=60
type MysqlExecutor ¶
type MysqlExecutor struct {
gorp.SqlExecutor
}
func WrapExecutor ¶
func WrapExecutor(executor gorp.SqlExecutor) *MysqlExecutor
func (*MysqlExecutor) Exec ¶
func (m *MysqlExecutor) Exec(query string, args ...interface{}) sql.Result
func (*MysqlExecutor) Get ¶
func (m *MysqlExecutor) Get(result interface{}, table string, idField string, id interface{})
func (*MysqlExecutor) GetBy ¶
func (m *MysqlExecutor) GetBy(result interface{}, table string, kvs map[string]interface{})
func (*MysqlExecutor) GetTable ¶
func (m *MysqlExecutor) GetTable(result interface{}, id interface{})
func (*MysqlExecutor) Insert ¶ added in v1.0.3
func (m *MysqlExecutor) Insert(obj interface{})
func (*MysqlExecutor) Inserts ¶
func (m *MysqlExecutor) Inserts(list ...interface{})
func (*MysqlExecutor) List ¶
func (m *MysqlExecutor) List(result interface{}, table string, idField string, ids []int)
func (*MysqlExecutor) ListBy ¶
func (m *MysqlExecutor) ListBy(result interface{}, table string, kvs map[string]interface{})
func (*MysqlExecutor) ListByStrIds ¶
func (m *MysqlExecutor) ListByStrIds(result interface{}, table string, idField string, ids []string)
func (*MysqlExecutor) Patch ¶
func (m *MysqlExecutor) Patch(table string, idField string, params interface{}) sql.Result
Patch update table by idFieldidField must in params ,update `table` set k1=v1,k2=v2 where `idField`=params[idField]
func (*MysqlExecutor) PatchArgs ¶ added in v1.0.9
func (m *MysqlExecutor) PatchArgs(table string, idField string, idValue interface{}, kvs ...interface{}) sql.Result
PatchArgs .update `table` set k1=v1,k2=v2 where `idField`=id ,
func (*MysqlExecutor) Select ¶
func (m *MysqlExecutor) Select(result interface{}, query string, args ...interface{})
func (*MysqlExecutor) SelectFloat ¶
func (m *MysqlExecutor) SelectFloat(query string, args ...interface{}) int64
func (*MysqlExecutor) SelectInt ¶
func (m *MysqlExecutor) SelectInt(query string, args ...interface{}) int64
func (*MysqlExecutor) SelectNullFloat ¶
func (m *MysqlExecutor) SelectNullFloat(query string, args ...interface{}) null.Float
func (*MysqlExecutor) SelectNullInt ¶
func (m *MysqlExecutor) SelectNullInt(query string, args ...interface{}) null.Int
func (*MysqlExecutor) SelectNullStr ¶
func (m *MysqlExecutor) SelectNullStr(query string, args ...interface{}) null.String
func (*MysqlExecutor) SelectOne ¶
func (m *MysqlExecutor) SelectOne(result interface{}, query string, args ...interface{})
func (*MysqlExecutor) SelectStr ¶
func (m *MysqlExecutor) SelectStr(query string, args ...interface{}) string
func (*MysqlExecutor) Updates ¶
func (m *MysqlExecutor) Updates(list ...interface{}) int64
func (*MysqlExecutor) With ¶
func (m *MysqlExecutor) With(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.