Documentation
¶
Index ¶
- func Escape(input string) string
- func Expr(expression string, args ...interface{}) interface{}
- type Expression
- func Group(query string) Expression
- func Join(query string, args ...interface{}) Expression
- func Model(value interface{}) Expression
- func Order(value interface{}) Expression
- func Page(pageNum int, perCount int) Expression
- func Select(query interface{}, args ...interface{}) Expression
- func Table(name string) Expression
- func Where(query interface{}, args ...interface{}) Expression
- type FieldName
- type Option
- type Repository
- func (repo *Repository) Exist(out interface{}, where ...interface{}) (e error)
- func (repo *Repository) Insert(val interface{}) (e error)
- func (repo *Repository) Migrate(initial func(*Repository), values ...interface{})
- func (repo *Repository) Modify(val interface{}) (e error)
- func (repo *Repository) ModifyColumn(val interface{}, attr string, upValue interface{}, where ...interface{}) (affects int64, e error)
- func (repo *Repository) ModifyColumns(val interface{}, columns interface{}, where ...interface{}) (affects int64, e error)
- func (repo *Repository) ModifyFunc(val interface{}, modifier func(interface{}), where ...interface{}) (e error)
- func (repo *Repository) Print(args ...interface{})
- func (repo *Repository) Query(out interface{}, count bool, exps ...Expression) (c int, e error)
- func (repo *Repository) Read(out interface{}, where ...interface{}) (e error)
- func (repo *Repository) ReadAll(out interface{}, where ...interface{}) (e error)
- func (repo *Repository) ReadAllWithOrderBy(out interface{}, orderby interface{}, where ...interface{}) (e error)
- func (repo *Repository) ReadWithOrderBy(out interface{}, orderby interface{}, where ...interface{}) (e error)
- func (repo *Repository) Remove(val interface{}, where ...interface{}) (e error)
- func (repo *Repository) RemoveWithAffect(val interface{}, where ...interface{}) (affects int64, e error)
- func (repo *Repository) SoftRemove(value interface{}, where ...interface{}) (e error)
- func (repo *Repository) Transaction(f func(*Repository) error) (e error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Expression ¶
func Group ¶
func Group(query string) Expression
func Join ¶
func Join(query string, args ...interface{}) Expression
func Model ¶
func Model(value interface{}) Expression
func Order ¶
func Order(value interface{}) Expression
func Page ¶
func Page(pageNum int, perCount int) Expression
func Select ¶
func Select(query interface{}, args ...interface{}) Expression
func Table ¶
func Table(name string) Expression
func Where ¶
func Where(query interface{}, args ...interface{}) Expression
type Repository ¶
Repository 仓储类
func (*Repository) Exist ¶
func (repo *Repository) Exist(out interface{}, where ...interface{}) (e error)
func (*Repository) Migrate ¶
func (repo *Repository) Migrate(initial func(*Repository), values ...interface{})
func (*Repository) ModifyColumn ¶
func (repo *Repository) ModifyColumn(val interface{}, attr string, upValue interface{}, where ...interface{}) (affects int64, e error)
更改单个字段
func (*Repository) ModifyColumns ¶
func (repo *Repository) ModifyColumns(val interface{}, columns interface{}, where ...interface{}) (affects int64, e error)
更改多个字段
func (*Repository) ModifyFunc ¶
func (repo *Repository) ModifyFunc(val interface{}, modifier func(interface{}), where ...interface{}) (e error)
ModifyFunc 使用函数更新
func (*Repository) Print ¶
func (repo *Repository) Print(args ...interface{})
func (*Repository) Query ¶
func (repo *Repository) Query(out interface{}, count bool, exps ...Expression) (c int, e error)
Query 查询列表(可分页)
func (*Repository) Read ¶
func (repo *Repository) Read(out interface{}, where ...interface{}) (e error)
Read 查询单条记录
func (*Repository) ReadAll ¶
func (repo *Repository) ReadAll(out interface{}, where ...interface{}) (e error)
ReadAll 查询单条
func (*Repository) ReadAllWithOrderBy ¶
func (repo *Repository) ReadAllWithOrderBy(out interface{}, orderby interface{}, where ...interface{}) (e error)
func (*Repository) ReadWithOrderBy ¶
func (repo *Repository) ReadWithOrderBy(out interface{}, orderby interface{}, where ...interface{}) (e error)
Read 查询单条记录
func (*Repository) Remove ¶
func (repo *Repository) Remove(val interface{}, where ...interface{}) (e error)
Remove 删除
func (*Repository) RemoveWithAffect ¶
func (repo *Repository) RemoveWithAffect(val interface{}, where ...interface{}) (affects int64, e error)
Remove 获取影响行数
func (*Repository) SoftRemove ¶
func (repo *Repository) SoftRemove(value interface{}, where ...interface{}) (e error)
func (*Repository) Transaction ¶
func (repo *Repository) Transaction(f func(*Repository) error) (e error)
Transaction 执行包装事务
Click to show internal directories.
Click to hide internal directories.