Documentation
¶
Index ¶
- type DAOProxy
- func (this *DAOProxy) AddRecord(vals interface{}) int
- func (this *DAOProxy) Bind(objPtr interface{}) *DAOProxy
- func (this *DAOProxy) DelRecord(id interface{}) int
- func (this *DAOProxy) DelRecordBy(where string, params ...interface{}) int
- func (this *DAOProxy) DelRecords(where string, params ...interface{}) int
- func (this *DAOProxy) Execute(sql string, params ...interface{}) int
- func (this *DAOProxy) Exists(id interface{}) bool
- func (this *DAOProxy) ExistsBy(where string, params ...interface{}) bool
- func (this *DAOProxy) Fillin(obj interface{}, data map[string]interface{})
- func (this *DAOProxy) FuncParam(param interface{}) string
- func (this *DAOProxy) GetCount(where string, params ...interface{}) int
- func (this *DAOProxy) GetCountField() string
- func (this *DAOProxy) GetDBReader() *lib.MysqlClient
- func (this *DAOProxy) GetFields() string
- func (this *DAOProxy) GetList(where string, start, num int, order string, params ...interface{}) (int, []map[string]interface{})
- func (this *DAOProxy) GetOne(field, where string, params ...interface{}) interface{}
- func (this *DAOProxy) GetPrimary() string
- func (this *DAOProxy) GetRecord(id interface{}) map[string]interface{}
- func (this *DAOProxy) GetRecordBy(where string, params ...interface{}) map[string]interface{}
- func (this *DAOProxy) GetRecords(where string, start, num int, order string, params ...interface{}) []map[string]interface{}
- func (this *DAOProxy) GetTable() string
- func (this *DAOProxy) Init(conf ...string)
- func (this *DAOProxy) InitTx(tx *lib.MysqlClient)
- func (this *DAOProxy) Query(sql string, params ...interface{}) []map[string]interface{}
- func (this *DAOProxy) ResetRecord(vals interface{}) int
- func (this *DAOProxy) SetCountField(field string) *DAOProxy
- func (this *DAOProxy) SetDefaultFields(fields string) *DAOProxy
- func (this *DAOProxy) SetFields(fields string) *DAOProxy
- func (this *DAOProxy) SetPrimary(field string)
- func (this *DAOProxy) SetRecord(vals interface{}, id interface{}) int
- func (this *DAOProxy) SetRecordBy(vals interface{}, where string, params ...interface{}) int
- func (this *DAOProxy) SetTable(table string)
- func (this *DAOProxy) UseIndex(idx string) *DAOProxy
- func (this *DAOProxy) UseMaster(flag ...bool) *DAOProxy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DAOProxy ¶
type DAOProxy struct {
DBWriter, DBReader *lib.MysqlClient
// contains filtered or unexported fields
}
func (*DAOProxy) AddRecord ¶
AddRecord、SetRecord、ResetRecord 支持传入map[string]interface{} 和 struct 两种类型参数 AddRecord {{{
func (*DAOProxy) Bind ¶
必须为指针 单条记录指向 struct , 多条记录指向[]struct 或 []*struct 使用: NewDAOUser().bind([]struct).GetRecords(...
func (*DAOProxy) DelRecordBy ¶
DelRecordBy {{{
func (*DAOProxy) DelRecords ¶
DelRecords {{{ Is Dangerous!
func (*DAOProxy) GetCountField ¶
func (*DAOProxy) GetDBReader ¶
func (this *DAOProxy) GetDBReader() *lib.MysqlClient
func (*DAOProxy) GetList ¶
func (this *DAOProxy) GetList(where string, start, num int, order string, params ...interface{}) (int, []map[string]interface{})
大数据下会有性能问题,请谨慎使用 由于底层每次查询都是从连接池中获取连接,所以开启只读事务,以保证FOUND_ROWS()的两条sql使用同一连接 GetList{{
func (*DAOProxy) GetPrimary ¶
func (*DAOProxy) GetRecordBy ¶
GetRecordBy {{{
func (*DAOProxy) GetRecords ¶
func (this *DAOProxy) GetRecords(where string, start, num int, order string, params ...interface{}) []map[string]interface{}
GetRecords {{{
func (*DAOProxy) InitTx ¶
func (this *DAOProxy) InitTx(tx *lib.MysqlClient)
func (*DAOProxy) ResetRecord ¶
ResetRecord {{{
func (*DAOProxy) SetCountField ¶
func (*DAOProxy) SetDefaultFields ¶
func (*DAOProxy) SetPrimary ¶
func (*DAOProxy) SetRecordBy ¶
SetRecordBy {{{
Click to show internal directories.
Click to hide internal directories.