Documentation ¶
Index ¶
- type Builder
- func (builder *Builder) Avg(columns ...interface{}) (orm.N, error)
- func (builder *Builder) Builder() *Builder
- func (builder *Builder) Chunk(size int, callback func(items []interface{}, page int) error, v ...interface{}) error
- func (builder *Builder) ChunkByID()
- func (builder *Builder) Clone() Query
- func (builder *Builder) Count(columns ...interface{}) (int64, error)
- func (builder *Builder) CrossJoin(table string) Query
- func (builder *Builder) CrossJoinSub(qb interface{}, alias string) Query
- func (builder *Builder) DB(usewrite ...bool) *sqlx.DB
- func (builder *Builder) DD()
- func (builder *Builder) Decrement(column interface{}, amount interface{}, extra ...interface{}) (int64, error)
- func (builder *Builder) Delete() (int64, error)
- func (builder *Builder) Distinct(args ...interface{}) Query
- func (builder *Builder) DoesntExist() (bool, error)
- func (builder *Builder) Dump()
- func (builder *Builder) Exists() (bool, error)
- func (builder *Builder) Find(id interface{}, args ...interface{}) (orm.R, error)
- func (builder *Builder) First(v ...interface{}) (orm.R, error)
- func (builder *Builder) From(from string) Query
- func (builder *Builder) FromRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) FromSub(qb interface{}, as string) Query
- func (builder *Builder) Get(v ...interface{}) ([]orm.R, error)
- func (builder *Builder) GetBindings() []interface{}
- func (builder *Builder) GroupBy(groups ...interface{}) Query
- func (builder *Builder) GroupByRaw(expression string, bindings ...interface{}) Query
- func (builder *Builder) Having(column interface{}, args ...interface{}) Query
- func (builder *Builder) HavingBetween(column interface{}, values interface{}, args ...interface{}) Query
- func (builder *Builder) HavingRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) InRandomOrder()
- func (builder *Builder) Increment(column interface{}, amount interface{}, extra ...interface{}) (int64, error)
- func (builder *Builder) Insert(v interface{}, columns ...interface{}) error
- func (builder *Builder) InsertGetID(v interface{}, args ...interface{}) (int64, error)
- func (builder *Builder) InsertOrIgnore(v interface{}, columns ...interface{}) (int64, error)
- func (builder *Builder) InsertUsing(qb interface{}, columns ...interface{}) (int64, error)
- func (builder *Builder) IsRead() bool
- func (builder *Builder) IsWrite() bool
- func (builder *Builder) Join(table string, first interface{}, args ...interface{}) Query
- func (builder *Builder) JoinRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) JoinSub(qb interface{}, alias string, first interface{}, args ...interface{}) Query
- func (builder *Builder) JoinWhere()
- func (builder *Builder) Latest()
- func (builder *Builder) LeftJoin(table string, first interface{}, args ...interface{}) Query
- func (builder *Builder) LeftJoinSub(qb interface{}, alias string, first interface{}, args ...interface{}) Query
- func (builder *Builder) LeftJoinWhere()
- func (builder *Builder) Limit(value int) Query
- func (builder *Builder) Lock(value interface{}) Query
- func (builder *Builder) LockForUpdate() Query
- func (builder *Builder) Max(columns ...interface{}) (orm.N, error)
- func (builder *Builder) Min(columns ...interface{}) (orm.N, error)
- func (builder *Builder) MustAvg(columns ...interface{}) orm.N
- func (builder *Builder) MustChunk(size int, callback func(items []interface{}, page int) error, v ...interface{})
- func (builder *Builder) MustChunkByID()
- func (builder *Builder) MustCount(columns ...interface{}) int64
- func (builder *Builder) MustDecrement(column interface{}, amount interface{}, extra ...interface{}) int64
- func (builder *Builder) MustDelete() int64
- func (builder *Builder) MustDoesntExist() bool
- func (builder *Builder) MustExists() bool
- func (builder *Builder) MustFind(id interface{}, args ...interface{}) orm.R
- func (builder *Builder) MustFirst(v ...interface{}) orm.R
- func (builder *Builder) MustGet(v ...interface{}) []orm.R
- func (builder *Builder) MustIncrement(column interface{}, amount interface{}, extra ...interface{}) int64
- func (builder *Builder) MustInsert(v interface{}, columns ...interface{})
- func (builder *Builder) MustInsertGetID(v interface{}, args ...interface{}) int64
- func (builder *Builder) MustInsertOrIgnore(v interface{}, columns ...interface{}) int64
- func (builder *Builder) MustInsertUsing(qb interface{}, columns ...interface{}) int64
- func (builder *Builder) MustMax(columns ...interface{}) orm.N
- func (builder *Builder) MustMin(columns ...interface{}) orm.N
- func (builder *Builder) MustPaginate(pageSize int, page int, v ...interface{}) orm.P
- func (builder *Builder) MustPluck()
- func (builder *Builder) MustSum(columns ...interface{}) orm.N
- func (builder *Builder) MustTruncate()
- func (builder *Builder) MustUpdate(v interface{}) int64
- func (builder *Builder) MustUpdateOrInsert(attributes interface{}, values ...interface{}) bool
- func (builder *Builder) MustUpsert(values interface{}, uniqueBy interface{}, update interface{}, ...) int64
- func (builder *Builder) MustValue(column string, v ...interface{}) interface{}
- func (builder *Builder) New() Query
- func (builder *Builder) NewBuilder() *Builder
- func (builder *Builder) Offset(value int) Query
- func (builder *Builder) Oldest()
- func (builder *Builder) On(first interface{}, args ...interface{}) Query
- func (builder *Builder) OrHaving(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrHavingBetween(column interface{}, values interface{}, args ...interface{}) Query
- func (builder *Builder) OrHavingRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) OrOn(first interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhere(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhereBetween(column interface{}, values interface{}) Query
- func (builder *Builder) OrWhereColumn(first interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhereDate(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhereDay(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhereExists(closure func(qb Query)) Query
- func (builder *Builder) OrWhereIn(column interface{}, values interface{}) Query
- func (builder *Builder) OrWhereJSONContains()
- func (builder *Builder) OrWhereJSONDoesntContain()
- func (builder *Builder) OrWhereJSONLength()
- func (builder *Builder) OrWhereMonth(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhereNotBetween(column interface{}, values interface{}) Query
- func (builder *Builder) OrWhereNotExists(closure func(qb Query)) Query
- func (builder *Builder) OrWhereNotIn(column interface{}, values interface{}) Query
- func (builder *Builder) OrWhereNotNull(column interface{}) Query
- func (builder *Builder) OrWhereNull(column interface{}) Query
- func (builder *Builder) OrWhereRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) OrWhereTime(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrWhereYear(column interface{}, args ...interface{}) Query
- func (builder *Builder) OrderBy(column interface{}, args ...string) Query
- func (builder *Builder) OrderByDesc(column interface{}) Query
- func (builder *Builder) OrderByRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) Paginate(pageSize int, page int, v ...interface{}) (orm.P, error)
- func (builder *Builder) Pluck()
- func (builder *Builder) Reorder(args ...interface{}) Query
- func (builder *Builder) Reset() Query
- func (builder *Builder) RightJoin(table string, first interface{}, args ...interface{}) Query
- func (builder *Builder) RightJoinSub(qb interface{}, alias string, first interface{}, args ...interface{}) Query
- func (builder *Builder) RightJoinWhere()
- func (builder *Builder) SQL(stmt string, bindings ...interface{}) Query
- func (builder *Builder) Select(columns ...interface{}) Query
- func (builder *Builder) SelectAppend(columns ...interface{}) Query
- func (builder *Builder) SelectRaw(expression string, bindings ...interface{}) Query
- func (builder *Builder) SelectSub(qb interface{}, as string) Query
- func (builder *Builder) SharedLock() Query
- func (builder *Builder) Skip(value int) Query
- func (builder *Builder) Sum(columns ...interface{}) (orm.N, error)
- func (builder *Builder) Table(name string) Query
- func (builder *Builder) Take(value int) Query
- func (builder *Builder) ToSQL() string
- func (builder *Builder) Truncate() error
- func (builder *Builder) Union(query interface{}, all ...bool) Query
- func (builder *Builder) UnionAll(query interface{}) Query
- func (builder *Builder) Unless(value bool, callback func(qb Query, value bool), ...) Query
- func (builder *Builder) Update(v interface{}) (int64, error)
- func (builder *Builder) UpdateOrInsert(attributes interface{}, values ...interface{}) (bool, error)
- func (builder *Builder) Upsert(v interface{}, uniqueBy interface{}, update interface{}, ...) (int64, error)
- func (builder *Builder) UseRead() Query
- func (builder *Builder) UseWrite() Query
- func (builder *Builder) Value(column string, v ...interface{}) (interface{}, error)
- func (builder *Builder) When(value bool, callback func(qb Query, value bool), ...) Query
- func (builder *Builder) Where(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereBetween(column interface{}, values interface{}) Query
- func (builder *Builder) WhereColumn(first interface{}, args ...interface{}) Query
- func (builder *Builder) WhereDate(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereDay(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereExists(closure func(qb Query)) Query
- func (builder *Builder) WhereIn(column interface{}, values interface{}) Query
- func (builder *Builder) WhereJSONContains()
- func (builder *Builder) WhereJSONDoesntContain()
- func (builder *Builder) WhereJSONLength()
- func (builder *Builder) WhereMonth(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereNotBetween(column interface{}, values interface{}) Query
- func (builder *Builder) WhereNotExists(closure func(qb Query)) Query
- func (builder *Builder) WhereNotIn(column interface{}, values interface{}) Query
- func (builder *Builder) WhereNotNull(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereNull(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereRaw(sql string, bindings ...interface{}) Query
- func (builder *Builder) WhereTime(column interface{}, args ...interface{}) Query
- func (builder *Builder) WhereYear(column interface{}, args ...interface{}) Query
- type Connection
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { Conn *Connection Query *dbal.Query Mode string Database string Schema string Grammar dbal.Grammar }
func NewBuilder ¶
func UseBuilder ¶
func UseBuilder(conn *Connection) *Builder
func (*Builder) CrossJoinSub ¶
func (*Builder) DoesntExist ¶
func (*Builder) GetBindings ¶
func (builder *Builder) GetBindings() []interface{}
func (*Builder) GroupByRaw ¶
func (*Builder) HavingBetween ¶
func (*Builder) InRandomOrder ¶
func (builder *Builder) InRandomOrder()
func (*Builder) InsertGetID ¶
func (*Builder) InsertOrIgnore ¶
func (*Builder) InsertUsing ¶
func (*Builder) LeftJoinSub ¶
func (*Builder) LeftJoinWhere ¶
func (builder *Builder) LeftJoinWhere()
func (*Builder) LockForUpdate ¶
func (*Builder) MustChunkByID ¶
func (builder *Builder) MustChunkByID()
func (*Builder) MustDecrement ¶
func (*Builder) MustDelete ¶
func (*Builder) MustDoesntExist ¶
func (*Builder) MustExists ¶
func (*Builder) MustIncrement ¶
func (*Builder) MustInsert ¶
func (builder *Builder) MustInsert(v interface{}, columns ...interface{})
func (*Builder) MustInsertGetID ¶
func (*Builder) MustInsertOrIgnore ¶
func (*Builder) MustInsertUsing ¶
func (*Builder) MustPaginate ¶
func (*Builder) MustTruncate ¶
func (builder *Builder) MustTruncate()
func (*Builder) MustUpdate ¶
func (*Builder) MustUpdateOrInsert ¶
func (*Builder) MustUpsert ¶
func (*Builder) NewBuilder ¶
func (*Builder) OrHavingBetween ¶
func (*Builder) OrHavingRaw ¶
func (*Builder) OrWhereBetween ¶
func (*Builder) OrWhereColumn ¶
func (*Builder) OrWhereDate ¶
func (*Builder) OrWhereDay ¶
func (*Builder) OrWhereExists ¶
func (*Builder) OrWhereJSONContains ¶
func (builder *Builder) OrWhereJSONContains()
func (*Builder) OrWhereJSONDoesntContain ¶
func (builder *Builder) OrWhereJSONDoesntContain()
func (*Builder) OrWhereJSONLength ¶
func (builder *Builder) OrWhereJSONLength()
func (*Builder) OrWhereMonth ¶
func (*Builder) OrWhereNotBetween ¶
func (*Builder) OrWhereNotExists ¶
func (*Builder) OrWhereNotIn ¶
func (*Builder) OrWhereNotNull ¶
func (*Builder) OrWhereNull ¶
func (*Builder) OrWhereRaw ¶
func (*Builder) OrWhereTime ¶
func (*Builder) OrWhereYear ¶
func (*Builder) OrderByDesc ¶
func (*Builder) OrderByRaw ¶
func (*Builder) RightJoinSub ¶
func (*Builder) RightJoinWhere ¶
func (builder *Builder) RightJoinWhere()
func (*Builder) SelectAppend ¶
func (*Builder) SharedLock ¶
func (*Builder) UpdateOrInsert ¶
func (*Builder) WhereBetween ¶
func (*Builder) WhereColumn ¶
func (*Builder) WhereExists ¶
func (*Builder) WhereJSONContains ¶
func (builder *Builder) WhereJSONContains()
func (*Builder) WhereJSONDoesntContain ¶
func (builder *Builder) WhereJSONDoesntContain()
func (*Builder) WhereJSONLength ¶
func (builder *Builder) WhereJSONLength()
func (*Builder) WhereMonth ¶
func (*Builder) WhereNotBetween ¶
func (*Builder) WhereNotExists ¶
func (*Builder) WhereNotIn ¶
func (*Builder) WhereNotNull ¶
type Connection ¶
type Query ¶
type Query interface { New() Query Clone() Query Reset() Query Builder() *Builder Table(name string) Query Get(v ...interface{}) ([]orm.R, error) MustGet(v ...interface{}) []orm.R First(v ...interface{}) (orm.R, error) MustFirst(v ...interface{}) orm.R Find(id interface{}, args ...interface{}) (orm.R, error) MustFind(id interface{}, args ...interface{}) orm.R Value(column string, v ...interface{}) (interface{}, error) MustValue(column string, v ...interface{}) interface{} Exists() (bool, error) MustExists() bool DoesntExist() (bool, error) MustDoesntExist() bool ToSQL() string GetBindings() []interface{} Paginate(perpage int, page int, v ...interface{}) (orm.P, error) MustPaginate(perpage int, page int, v ...interface{}) orm.P Chunk(size int, callback func(items []interface{}, page int) error, v ...interface{}) error MustChunk(size int, callback func(items []interface{}, page int) error, v ...interface{}) DB(usewrite ...bool) *sqlx.DB IsRead() bool UseRead() Query UseWrite() Query IsWrite() bool Count(columns ...interface{}) (int64, error) MustCount(columns ...interface{}) int64 Min(columns ...interface{}) (orm.N, error) MustMin(columns ...interface{}) orm.N Max(columns ...interface{}) (orm.N, error) MustMax(columns ...interface{}) orm.N Sum(columns ...interface{}) (orm.N, error) MustSum(columns ...interface{}) orm.N Avg(columns ...interface{}) (orm.N, error) MustAvg(columns ...interface{}) orm.N SQL(stmt string, bindings ...interface{}) Query Select(columns ...interface{}) Query SelectAppend(columns ...interface{}) Query SelectRaw(expression string, bindings ...interface{}) Query SelectSub(qb interface{}, alias string) Query Distinct(args ...interface{}) Query From(name string) Query FromRaw(sql string, bindings ...interface{}) Query FromSub(qb interface{}, alias string) Query Union(query interface{}, all ...bool) Query UnionAll(query interface{}) Query Join(table string, first interface{}, args ...interface{}) Query JoinRaw(sql string, bindings ...interface{}) Query JoinSub(qb interface{}, alias string, first interface{}, args ...interface{}) Query LeftJoin(table string, first interface{}, args ...interface{}) Query LeftJoinSub(qb interface{}, alias string, first interface{}, args ...interface{}) Query RightJoin(table string, first interface{}, args ...interface{}) Query RightJoinSub(qb interface{}, alias string, first interface{}, args ...interface{}) Query CrossJoin(table string) Query CrossJoinSub(qb interface{}, alias string) Query On(first interface{}, args ...interface{}) Query OrOn(first interface{}, args ...interface{}) Query Where(column interface{}, args ...interface{}) Query OrWhere(column interface{}, args ...interface{}) Query WhereColumn(first interface{}, args ...interface{}) Query OrWhereColumn(first interface{}, args ...interface{}) Query WhereNull(column interface{}, args ...interface{}) Query OrWhereNull(column interface{}) Query WhereNotNull(column interface{}, args ...interface{}) Query OrWhereNotNull(column interface{}) Query WhereRaw(sql string, bindings ...interface{}) Query OrWhereRaw(sql string, bindings ...interface{}) Query WhereBetween(column interface{}, values interface{}) Query OrWhereBetween(column interface{}, values interface{}) Query WhereNotBetween(column interface{}, values interface{}) Query OrWhereNotBetween(column interface{}, values interface{}) Query WhereIn(column interface{}, values interface{}) Query OrWhereIn(column interface{}, values interface{}) Query WhereNotIn(column interface{}, values interface{}) Query OrWhereNotIn(column interface{}, values interface{}) Query WhereExists(closure func(qb Query)) Query OrWhereExists(closure func(qb Query)) Query WhereNotExists(closure func(qb Query)) Query OrWhereNotExists(closure func(qb Query)) Query WhereDate(column interface{}, args ...interface{}) Query OrWhereDate(column interface{}, args ...interface{}) Query WhereTime(column interface{}, args ...interface{}) Query OrWhereTime(column interface{}, args ...interface{}) Query WhereYear(column interface{}, args ...interface{}) Query OrWhereYear(column interface{}, args ...interface{}) Query WhereMonth(column interface{}, args ...interface{}) Query OrWhereMonth(column interface{}, args ...interface{}) Query WhereDay(column interface{}, args ...interface{}) Query OrWhereDay(column interface{}, args ...interface{}) Query When(value bool, callback func(qb Query, value bool), defaults ...func(qb Query, value bool)) Query Unless(value bool, callback func(qb Query, value bool), defaults ...func(qb Query, value bool)) Query GroupBy(groups ...interface{}) Query GroupByRaw(expression string, bindings ...interface{}) Query Having(column interface{}, args ...interface{}) Query OrHaving(column interface{}, args ...interface{}) Query HavingBetween(column interface{}, values interface{}, args ...interface{}) Query OrHavingBetween(column interface{}, values interface{}, args ...interface{}) Query HavingRaw(sql string, bindings ...interface{}) Query OrHavingRaw(sql string, bindings ...interface{}) Query OrderBy(column interface{}, args ...string) Query OrderByDesc(column interface{}) Query OrderByRaw(sql string, bindings ...interface{}) Query Skip(value int) Query Offset(value int) Query Take(value int) Query Limit(value int) Query LockForUpdate() Query Insert(v interface{}, columns ...interface{}) error MustInsert(v interface{}, columns ...interface{}) InsertOrIgnore(v interface{}, columns ...interface{}) (int64, error) MustInsertOrIgnore(v interface{}, columns ...interface{}) int64 InsertGetID(v interface{}, args ...interface{}) (int64, error) MustInsertGetID(v interface{}, args ...interface{}) int64 InsertUsing(qb interface{}, columns ...interface{}) (int64, error) MustInsertUsing(qb interface{}, columns ...interface{}) int64 Upsert(values interface{}, uniqueBy interface{}, update interface{}, columns ...interface{}) (int64, error) MustUpsert(values interface{}, uniqueBy interface{}, update interface{}, columns ...interface{}) int64 UpdateOrInsert(attributes interface{}, values ...interface{}) (bool, error) MustUpdateOrInsert(attributes interface{}, values ...interface{}) bool Update(v interface{}) (int64, error) MustUpdate(v interface{}) int64 Increment(column interface{}, amount interface{}, extra ...interface{}) (int64, error) MustIncrement(column interface{}, amount interface{}, extra ...interface{}) int64 Decrement(column interface{}, amount interface{}, extra ...interface{}) (int64, error) MustDecrement(column interface{}, amount interface{}, extra ...interface{}) int64 Delete() (int64, error) MustDelete() int64 Truncate() error MustTruncate() DD() Dump() }
func Use ¶
func Use(conn *Connection) Query
Click to show internal directories.
Click to hide internal directories.