Documentation ¶
Index ¶
- Constants
- Variables
- type AndConditions
- type Assignment
- type Builder
- type Clause
- type ClauseBuilder
- type Column
- type Delete
- type Eq
- type Expr
- type Expression
- type For
- type From
- type GroupBy
- type Gt
- type Gte
- type IN
- type Insert
- type Interface
- type Join
- type JoinType
- type Like
- type Limit
- type Locking
- type Lt
- type Lte
- type NegationExpressionBuilder
- type Neq
- type NotConditions
- type OnConflict
- type OrConditions
- type OrderBy
- type OrderByColumn
- type Returning
- type Select
- type Set
- type Table
- type Update
- type Values
- type Where
- type With
- type Writer
Constants ¶
const ( PrimaryKey string = "@@@priamry_key@@@" CurrentTable string = "@@@table@@@" )
const ( CrossJoin JoinType = "CROSS" InnerJoin = "INNER" LeftJoin = "LEFT" RightJoin = "RIGHT" )
Variables ¶
var (
PrimaryColumn = Column{Table: CurrentTable, Name: PrimaryKey}
)
Functions ¶
This section is empty.
Types ¶
type AndConditions ¶
type AndConditions struct {
Exprs []Expression
}
func (AndConditions) Build ¶
func (and AndConditions) Build(builder Builder)
type Assignment ¶
type Assignment struct { Column Column Value interface{} }
type Builder ¶
type Builder interface { Writer WriteQuoted(field interface{}) error AddVar(Writer, ...interface{}) }
Builder builder interface
type Clause ¶
type Clause struct { Name string // WHERE Priority float64 BeforeExpressions []Expression AfterNameExpressions []Expression AfterExpressions []Expression Expression Expression Builder ClauseBuilder }
Clause
type ClauseBuilder ¶
ClauseBuilder clause builder, allows to custmize how to build clause
type Eq ¶
type Eq struct { Column interface{} Value interface{} }
Eq equal to for where
func (Eq) NegationBuild ¶
type Expression ¶
type Expression interface {
Build(builder Builder)
}
Expression expression interface
func And ¶
func And(exprs ...Expression) Expression
func Not ¶
func Not(exprs ...Expression) Expression
func Or ¶
func Or(exprs ...Expression) Expression
type For ¶
type For struct {
Lockings []Locking
}
func (For) MergeClause ¶
MergeClause merge order by clauses
type GroupBy ¶
type GroupBy struct { Columns []Column Having []Expression }
GroupBy group by clause
func (GroupBy) MergeClause ¶
MergeClause merge group by clause
type IN ¶
type IN struct { Column interface{} Values []interface{} }
IN Whether a value is within a set of values
func (IN) NegationBuild ¶
type Insert ¶
func (Insert) MergeClause ¶
MergeClause merge insert clause
type Join ¶
type Join struct { Type JoinType Table Table ON Where Using []string Expression Expression }
Join join clause for from
type NegationExpressionBuilder ¶
type NegationExpressionBuilder interface {
NegationBuild(builder Builder)
}
NegationExpressionBuilder negation expression builder
type NotConditions ¶
type NotConditions struct {
Exprs []Expression
}
func (NotConditions) Build ¶
func (not NotConditions) Build(builder Builder)
type OnConflict ¶
func (OnConflict) Build ¶
func (onConflict OnConflict) Build(builder Builder)
Build build onConflict clause
func (OnConflict) MergeClause ¶
func (onConflict OnConflict) MergeClause(clause *Clause)
MergeClause merge onConflict clauses
func (OnConflict) Name ¶
func (OnConflict) Name() string
type OrConditions ¶
type OrConditions struct {
Exprs []Expression
}
func (OrConditions) Build ¶
func (or OrConditions) Build(builder Builder)
type OrderBy ¶
type OrderBy struct {
Columns []OrderByColumn
}
func (OrderBy) MergeClause ¶
MergeClause merge order by clauses
type OrderByColumn ¶
type Returning ¶
type Returning struct {
Columns []Column
}
func (Returning) MergeClause ¶
MergeClause merge order by clauses
type Select ¶
type Select struct { Columns []Column Expression Expression }
Select select attrs when querying, updating, creating
func (Select) MergeClause ¶
type Update ¶
func (Update) MergeClause ¶
MergeClause merge update clause
type Values ¶
type Values struct { Columns []Column Values [][]interface{} }
func (Values) MergeClause ¶
MergeClause merge values clauses
type Where ¶
type Where struct {
Exprs []Expression
}
Where where clause
func (Where) MergeClause ¶
MergeClause merge where clauses