Documentation
¶
Index ¶
- Constants
- type Aliased
- type BoolVal
- type CNot
- type CNotNull
- type Col
- type Ctx
- type CtxParam
- type CustomCol
- type FloatVal
- type ISelect
- type In
- type IntVal
- type Join
- type LimitBy
- type LogicalOp
- func And(clauses ...SQLCondition) *LogicalOp
- func BinaryLogicalOp(fn string, left SQLObject, right SQLObject) *LogicalOp
- func Eq(left SQLObject, right SQLObject) *LogicalOp
- func Ge(left SQLObject, right SQLObject) *LogicalOp
- func Gt(left SQLObject, right SQLObject) *LogicalOp
- func Le(left SQLObject, right SQLObject) *LogicalOp
- func Lt(left SQLObject, right SQLObject) *LogicalOp
- func Neq(left SQLObject, right SQLObject) *LogicalOp
- func NewGenericLogicalOp(fn string, clauses ...SQLCondition) *LogicalOp
- func Or(clauses ...SQLCondition) *LogicalOp
- type OrderBy
- type RawObject
- type SQLCondition
- type SQLObject
- type Select
- func (s *Select) AddJoin(joins ...*Join) ISelect
- func (s *Select) AddLimit(limit ...SQLObject) ISelect
- func (s *Select) AddWindows(windows ...*WindowFunction) ISelect
- func (s *Select) AddWith(withs ...*With) ISelect
- func (s *Select) AndHaving(clauses ...SQLCondition) ISelect
- func (s *Select) AndPreWhere(clauses ...SQLCondition) ISelect
- func (s *Select) AndWhere(clauses ...SQLCondition) ISelect
- func (s *Select) Distinct(distinct bool) ISelect
- func (s *Select) DropWith(alias ...string) ISelect
- func (s *Select) From(table SQLObject) ISelect
- func (s *Select) GetDistinct() bool
- func (s *Select) GetFrom() SQLObject
- func (s *Select) GetGroupBy() []SQLObject
- func (s *Select) GetHaving() SQLCondition
- func (s *Select) GetJoin() []*Join
- func (s *Select) GetLimit() SQLObject
- func (s *Select) GetOffset() SQLObject
- func (s *Select) GetOrderBy() []SQLObject
- func (s *Select) GetPreWhere() SQLCondition
- func (s *Select) GetSelect() []SQLObject
- func (s *Select) GetSettings(table SQLObject) map[string]string
- func (s *Select) GetWhere() SQLCondition
- func (s *Select) GetWindows() []*WindowFunction
- func (s *Select) GetWith() []*With
- func (s *Select) GroupBy(fields ...SQLObject) ISelect
- func (s *Select) Join(joins ...*Join) ISelect
- func (s *Select) Limit(limit ...SQLObject) ISelect
- func (s *Select) Offset(offset SQLObject) ISelect
- func (s *Select) OrHaving(clauses ...SQLCondition) ISelect
- func (s *Select) OrPreWhere(clauses ...SQLCondition) ISelect
- func (s *Select) OrWhere(clauses ...SQLCondition) ISelect
- func (s *Select) OrderBy(fields ...SQLObject) ISelect
- func (s *Select) Select(cols ...SQLObject) ISelect
- func (s *Select) SetHaving(having SQLCondition) ISelect
- func (s *Select) SetSetting(name string, value string) ISelect
- func (s *Select) SetWindows(windows ...*WindowFunction) ISelect
- func (s *Select) String(ctx *Ctx, options ...int) (string, error)
- func (s *Select) With(withs ...*With) ISelect
- type StringVal
- type WindowFunction
- type WindowFunctionRef
- type WindowPoint
- type With
- type WithRef
Constants ¶
View Source
const ( STRING_OPT_SKIP_WITH = 1 STRING_OPT_INLINE_WITH = 2 ORDER_BY_DIRECTION_ASC = 3 ORDER_BY_DIRECTION_DESC = 4 WITH_REF_NO_ALIAS = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CNot ¶
type CNot struct {
// contains filtered or unexported fields
}
func (*CNot) GetFunction ¶
type CNotNull ¶
type CNotNull struct {
// contains filtered or unexported fields
}
func (*CNotNull) GetFunction ¶
type Ctx ¶
type Ctx struct {
Params map[string]SQLObject
Result map[string]SQLObject
// contains filtered or unexported fields
}
func DefaultCtx ¶
func DefaultCtx() *Ctx
type CtxParam ¶
type CtxParam struct {
// contains filtered or unexported fields
}
func NewCtxParam ¶
func NewCtxParamOrDef ¶
type ISelect ¶
type ISelect interface {
Distinct(distinct bool) ISelect
GetDistinct() bool
Select(cols ...SQLObject) ISelect
GetSelect() []SQLObject
From(table SQLObject) ISelect
GetFrom() SQLObject
AndWhere(clauses ...SQLCondition) ISelect
OrWhere(clauses ...SQLCondition) ISelect
GetWhere() SQLCondition
AndPreWhere(clauses ...SQLCondition) ISelect
OrPreWhere(clauses ...SQLCondition) ISelect
GetPreWhere() SQLCondition
AndHaving(clauses ...SQLCondition) ISelect
OrHaving(clauses ...SQLCondition) ISelect
GetHaving() SQLCondition
SetHaving(having SQLCondition) ISelect
GroupBy(fields ...SQLObject) ISelect
GetGroupBy() []SQLObject
OrderBy(fields ...SQLObject) ISelect
GetOrderBy() []SQLObject
Limit(limit ...SQLObject) ISelect
AddLimit(limit ...SQLObject) ISelect
GetLimit() SQLObject
Offset(offset SQLObject) ISelect
GetOffset() SQLObject
With(withs ...*With) ISelect
AddWith(withs ...*With) ISelect
DropWith(alias ...string) ISelect
GetWith() []*With
Join(joins ...*Join) ISelect
AddJoin(joins ...*Join) ISelect
GetJoin() []*Join
String(ctx *Ctx, options ...int) (string, error)
SetSetting(name string, value string) ISelect
GetSettings(table SQLObject) map[string]string
AddWindows(windows ...*WindowFunction) ISelect
GetWindows() []*WindowFunction
SetWindows(windows ...*WindowFunction) ISelect
}
type Join ¶
type Join struct {
// contains filtered or unexported fields
}
func (*Join) GetOn ¶
func (l *Join) GetOn() SQLCondition
type LimitBy ¶ added in v4.1.1
type LimitBy struct {
// contains filtered or unexported fields
}
func NewLimitBy ¶ added in v4.1.1
type LogicalOp ¶
type LogicalOp struct {
// contains filtered or unexported fields
}
func And ¶
func And(clauses ...SQLCondition) *LogicalOp
func NewGenericLogicalOp ¶
func NewGenericLogicalOp(fn string, clauses ...SQLCondition) *LogicalOp
func Or ¶
func Or(clauses ...SQLCondition) *LogicalOp
func (*LogicalOp) AppendEntity ¶
func (op *LogicalOp) AppendEntity(clauses ...SQLCondition)
func (*LogicalOp) GetFunction ¶
type RawObject ¶
type RawObject struct {
// contains filtered or unexported fields
}
func FmtRawObject ¶
func NewRawObject ¶
type SQLCondition ¶
type SQLCondition interface {
GetFunction() string
GetEntity() []SQLObject
String(ctx *Ctx, options ...int) (string, error)
}
func Not ¶
func Not(expr SQLObject) SQLCondition
func NotNull ¶
func NotNull(obj SQLObject) SQLCondition
type Select ¶
type Select struct {
// contains filtered or unexported fields
}
func (*Select) AddWindows ¶
func (s *Select) AddWindows(windows ...*WindowFunction) ISelect
func (*Select) AndHaving ¶
func (s *Select) AndHaving(clauses ...SQLCondition) ISelect
func (*Select) AndPreWhere ¶
func (s *Select) AndPreWhere(clauses ...SQLCondition) ISelect
func (*Select) AndWhere ¶
func (s *Select) AndWhere(clauses ...SQLCondition) ISelect
func (*Select) GetDistinct ¶
func (*Select) GetGroupBy ¶
func (*Select) GetHaving ¶
func (s *Select) GetHaving() SQLCondition
func (*Select) GetOrderBy ¶
func (*Select) GetPreWhere ¶
func (s *Select) GetPreWhere() SQLCondition
func (*Select) GetWhere ¶
func (s *Select) GetWhere() SQLCondition
func (*Select) GetWindows ¶
func (s *Select) GetWindows() []*WindowFunction
func (*Select) OrHaving ¶
func (s *Select) OrHaving(clauses ...SQLCondition) ISelect
func (*Select) OrPreWhere ¶
func (s *Select) OrPreWhere(clauses ...SQLCondition) ISelect
func (*Select) OrWhere ¶
func (s *Select) OrWhere(clauses ...SQLCondition) ISelect
func (*Select) SetHaving ¶
func (s *Select) SetHaving(having SQLCondition) ISelect
func (*Select) SetWindows ¶
func (s *Select) SetWindows(windows ...*WindowFunction) ISelect
type WindowFunction ¶
type WindowFunction struct {
Alias string
PartitionBy []SQLObject
OrderBy []SQLObject
Rows bool
Start WindowPoint
End WindowPoint
}
type WindowFunctionRef ¶
type WindowFunctionRef struct {
Fn *WindowFunction
}
type WindowPoint ¶
Click to show internal directories.
Click to hide internal directories.