Documentation
¶
Index ¶
- type Model
- func (p *Model) Connect(connectName string) *Model
- func (p *Model) ConnectAdd(connectName string, connect Connect) *Model
- func (p *Model) Count() (count int64, err error)
- func (p *Model) Delete() (count int64, err error)
- func (p *Model) ExecSql(sql string, args ...interface{}) (affectCount int64, lastInsertId int64, err error)
- func (p *Model) Field(fields ...string) *Model
- func (p *Model) First() (has bool, err error)
- func (p *Model) Get() (has bool, err error)
- func (p *Model) GetAutoSetField(method string) (needSet map[string]interface{}, err error)
- func (p *Model) Insert() (err error)
- func (p *Model) InsertMap(maps map[string]interface{}) (pk int64, err error)
- func (p *Model) Limit(skip int, len int) *Model
- func (p *Model) Model(m interface{}) *Model
- func (p *Model) OrderBy(field string, desc bool) *Model
- func (p *Model) Page(page int, pageSize int) (pageData Page, has bool, err error)
- func (p *Model) PageWithOutTotal(page int, pageSize int) (pageData Page, has bool, err error)
- func (p *Model) QuerySql(sql string, args ...interface{}) (has bool, data []map[string]interface{}, err error)
- func (p *Model) QueryToMap() (has bool, data []map[string]interface{}, err error)
- func (p *Model) Reset() *Model
- func (p *Model) Sqls() []string
- func (p *Model) Table(table string) *Model
- func (p *Model) Update() (count int64, err error)
- func (p *Model) UpdateMap(mapper map[string]interface{}) (count int64, err error)
- func (p *Model) Where(condition string, values ...interface{}) *Model
- func (p *Model) WhereIn(field string, params ...interface{}) *Model
- type Page
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func (*Model) ConnectAdd ¶
指定哪个连接 并将传入的连接放入配置项, 下一次可直接使用
func (*Model) GetAutoSetField ¶
取得在method操作时需要自动填充的字段与值
func (*Model) PageWithOutTotal ¶
func (*Model) QuerySql ¶
func (p *Model) QuerySql(sql string, args ...interface{}) (has bool, data []map[string]interface{}, err error)
原始方法 查询sql返回map
func (*Model) QueryToMap ¶
查询主方法,返回[]Map原数据给get和first使用
Click to show internal directories.
Click to hide internal directories.