Documentation ¶
Index ¶
- func And(args ...wherePart) wherePart
- func Between(fieldName Column, from, to interface{}) wherePart
- func EQ(fieldName Column, value interface{}) wherePart
- func EQF(fieldName1, fieldName2 string) wherePart
- func Exists(clause *Q) wherePart
- func GT(fieldName Column, value interface{}) wherePart
- func GTOE(fieldName Column, value interface{}) wherePart
- func IN(fieldName Column, values ...interface{}) wherePart
- func INInt64(fieldName Column, values []int64) wherePart
- func INString(fieldName Column, values []string) wherePart
- func LT(fieldName Column, value interface{}) wherePart
- func LTOE(fieldName Column, value interface{}) wherePart
- func Like(fieldName Column, value string) wherePart
- func NE(fieldName Column, value interface{}) wherePart
- func NotLike(fieldName Column, value string) wherePart
- func Or(args ...wherePart) wherePart
- func PE() wherePart
- func PS() wherePart
- func Union(queries ...*Q) (string, error)
- func WhereAll() wherePart
- type Column
- type IModel
- type Q
- func (q *Q) Alias(alias string) *Q
- func (q *Q) Count(name Column, as string) *Q
- func (q *Q) Field(name Column) *Q
- func (q *Q) FieldAs(name Column, as string) *Q
- func (q *Q) FieldRaw(fieldStr, as string) *Q
- func (q *Q) Fields(fields ...string) *Q
- func (q *Q) Limit(limit, offset int64) *Q
- func (q *Q) OrderBy(col Column, dir QueryOrderBy) *Q
- func (q *Q) Set(fieldName Column, value interface{}) *Q
- func (q *Q) String() (string, error)
- func (q *Q) Sum(name Column, as string) *Q
- func (q *Q) Where(args ...wherePart) *Q
- type QueryOrderBy
- type QueryType
- type TableName
- type WhereType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EQ ¶
func EQ(fieldName Column, value interface{}) wherePart
EQ is an equals statement between a table column and a value
func INInt64 ¶ added in v1.8.15
INInt64 is a helper function for converting a slice of string arguments into a slice of interface arguments, passed into an IN clause and returned
Types ¶
type IModel ¶
type IModel interface { Table_Name() TableName Table_Columns() []Column Table_PrimaryKey() Column Table_PrimaryKey_Value() int64 Table_InsertColumns() []Column Table_UpdateColumns() []Column Table_Column_Types() map[Column]string String() string Update() string Create() string Destroy() string FromID(id int64) string }
type Q ¶
type Q struct {
// contains filtered or unexported fields
}
func (*Q) FieldAs ¶
FieldAs includes a specific field in the columns to be returned by a set aliased by `as`
type QueryOrderBy ¶ added in v1.8.23
type QueryOrderBy int
const ( QueryOrderByASC QueryOrderBy = iota QueryOrderByDESC )
func (QueryOrderBy) String ¶ added in v1.8.23
func (q QueryOrderBy) String() string
type WhereType ¶
type WhereType int
const ( WhereTypeEquals WhereType = iota WhereTypeEqualsField WhereTypeNotEquals WhereTypeGreaterThan WhereTypeLessThan WhereTypeGreaterThanOrEqualTo WhereTypeLessThanOrEqualTo WhereTypeBetween WhereTypeLike WhereTypeNotLike WhereTypeIN WhereTypeExists WhereTypeAnd WhereTypeOr WhereTypeParenthesisEnd WhereTypeParenthesisStart // WhereTypeAll is a WHERE clause of `1=1` used for convenience // when conditionally adding WHERE clauses starting with a conjunction (AND/OR,etc) // separating them. // e.g. SELECT * FROM `Foo` WHERE 1=1 // SELECT * FROM `Foo` WHERE 1=1 AND FooID = 123; WhereTypeAll )
Click to show internal directories.
Click to hide internal directories.