Documentation
¶
Index ¶
- func ParseRows(rows *sql.Rows) ([]contracts.Fields, error)
- func WithTX(name string, tx contracts.DBTx) contracts.QueryBuilder
- type CreateException
- type DeleteException
- type InsertException
- type NotFoundException
- type SelectException
- type Table
- func (this *Table) Avg(column string, as ...string) int64
- func (this *Table) Chunk(size int, handler func(collection contracts.Collection, page int) error) (err error)
- func (this *Table) ChunkById(size int, handler func(collection contracts.Collection, page int) error) error
- func (this *Table) Count(columns ...string) int64
- func (this *Table) Create(fields contracts.Fields) interface{}
- func (this *Table) Delete() int64
- func (this *Table) Find(key interface{}) interface{}
- func (this *Table) First() interface{}
- func (this *Table) FirstOrCreate(values ...contracts.Fields) interface{}
- func (this *Table) FirstOrFail() interface{}
- func (this *Table) Get() contracts.Collection
- func (this *Table) Insert(values ...contracts.Fields) bool
- func (this *Table) InsertGetId(values ...contracts.Fields) int64
- func (this *Table) InsertOrIgnore(values ...contracts.Fields) int64
- func (this *Table) InsertOrReplace(values ...contracts.Fields) int64
- func (this *Table) Max(column string, as ...string) int64
- func (this *Table) Min(column string, as ...string) int64
- func (this *Table) SetClass(class contracts.Class) *Table
- func (this *Table) SetConnection(connection interface{}) *Table
- func (this *Table) SetExecutor(executor contracts.SqlExecutor) contracts.QueryBuilder
- func (this *Table) SetPrimaryKey(name string) *Table
- func (this *Table) Sum(column string, as ...string) int64
- func (this *Table) Update(fields contracts.Fields) int64
- func (this *Table) UpdateOrCreate(attributes contracts.Fields, values ...contracts.Fields) interface{}
- func (this *Table) UpdateOrInsert(attributes contracts.Fields, values ...contracts.Fields) bool
- type UpdateException
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateException ¶
type DeleteException ¶
type InsertException ¶
type NotFoundException ¶
type SelectException ¶
type Table ¶
type Table struct {
contracts.QueryBuilder
// contains filtered or unexported fields
}
func WithConnection ¶
WithConnection 使用指定链接
func (*Table) FirstOrCreate ¶
func (*Table) FirstOrFail ¶
func (this *Table) FirstOrFail() interface{}
func (*Table) Get ¶
func (this *Table) Get() contracts.Collection
func (*Table) InsertOrReplace ¶
func (*Table) SetConnection ¶
SetConnection 参数要么是 contracts.DBConnection 要么是 string
func (*Table) SetExecutor ¶
func (this *Table) SetExecutor(executor contracts.SqlExecutor) contracts.QueryBuilder
SetExecutor 参数必须是 contracts.DBTx 实例
func (*Table) SetPrimaryKey ¶
SetPrimaryKey 设置主键
func (*Table) UpdateOrCreate ¶
type UpdateException ¶
Click to show internal directories.
Click to hide internal directories.