stmt

package
v0.0.0-...-81ee819 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FormatEurope   = NewVal("EUR")
	FormatUSA      = NewVal("USA")
	FormatJIS      = NewVal("JIS")
	FormatISO      = NewVal("ISO")
	FormatInternal = NewVal("INTERNAL")
)
View Source
var (
	WeekMode0 = NewVal(0)
	WeekMode1 = NewVal(1)
	WeekMode2 = NewVal(2)
	WeekMode3 = NewVal(3)
	WeekMode4 = NewVal(4)
	WeekMode5 = NewVal(5)
	WeekMode6 = NewVal(6)
	WeekMode7 = NewVal(7)
)
View Source
var (
	UnitMicrosecond       = NewVal(Microsecond)
	UnitSecond            = NewVal(Second)
	UnitMinute            = NewVal(Minute)
	UnitHour              = NewVal(Hour)
	UnitDay               = NewVal(Day)
	UnitWeek              = NewVal(Week)
	UnitMonth             = NewVal(Month)
	UnitQuarter           = NewVal(Quarter)
	UnitYear              = NewVal(Year)
	UnitSecondMicrosecond = NewVal(SecondMicrosecond)
	UnitMinuteMicrosecond = NewVal(MinuteMicrosecond)
	UnitMinuteSecond      = NewVal(MinuteSecond)
	UnitHourMicrosecond   = NewVal(HourMicrosecond)
	UnitHourSecond        = NewVal(HourSecond)
	UnitHourMinute        = NewVal(HourMinute)
	UnitDayMicrosecond    = NewVal(DayMicrosecond)
	UnitDaySecond         = NewVal(DaySecond)
	UnitDayMinute         = NewVal(DayMinute)
	UnitDayHour           = NewVal(DayHour)
	UnitYearMonth         = NewVal(YearMonth)
)
View Source
var (
	Microsecond       = "MICROSECOND"
	Second            = "SECOND"
	Minute            = "MINUTE"
	Hour              = "HOUR"
	Day               = "DAY"
	Week              = "WEEK"
	Month             = "MONTH"
	Quarter           = "QUARTER"
	Year              = "YEAR"
	SecondMicrosecond = "SECOND_MICROSECOND"
	MinuteMicrosecond = "MINUTE_MICROSECOND"
	MinuteSecond      = "MINUTE_SECOND"
	HourMicrosecond   = "HOUR_MICROSECOND"
	HourSecond        = "HOUR_SECOND"
	HourMinute        = "HOUR_MINUTE"
	DayMicrosecond    = "DAY_MICROSECOND"
	DaySecond         = "DAY_SECOND"
	DayMinute         = "DAY_MINUTE"
	DayHour           = "DAY_HOUR"
	YearMonth         = "YEAR_MONTH"
)

Functions

func Nodeize

func Nodeize(stmt Statement) (tokenizer.Tokenizer, []interface{})

Types

type Args

type Args []Statement

type Assign

type Assign struct {
	// contains filtered or unexported fields
}

func NewAssign

func NewAssign(column Column, param ValOrFuncOrSub) Assign

type Between

type Between struct {
	// contains filtered or unexported fields
}

func NewBetween

func NewBetween(from, to ValOrColOrFuncOrSub) Between

type ColOrAlias

type ColOrAlias interface {
	Statement
	// contains filtered or unexported methods
}

type ColOrAliasOrSub

type ColOrAliasOrSub interface {
	Statement
	// contains filtered or unexported methods
}

type ColOrSub

type ColOrSub interface {
	Statement
	// contains filtered or unexported methods
}

type Column

type Column struct {
	Name string
	// contains filtered or unexported fields
}

Column is a stmt to indicate a column in a table.

func NewColumn

func NewColumn(name string) Column

NewColumn returns a new Column.

func (Column) As

func (c Column) As(alias string) ColumnAlias

As is used to give an alias name to the column. Returns a new ColumnAs.

func (Column) Asc

func (c Column) Asc() Order

func (Column) Assign

func (c Column) Assign(param ValOrFuncOrSub) Assign

Assign is used to assign a params to the column. This constitutes a part of the record update stmt. Returns a new Assign.

func (Column) Between

func (c Column) Between(from, to ValOrColOrFuncOrSub) Between

func (Column) Define

func (c Column) Define(definition string) Definition

Define is used to specify a definition for the column. This constitutes a part of the table creation. Returns a new Definition.

func (Column) Desc

func (c Column) Desc() Order

func (Column) Eq

func (Column) EqAll

func (c Column) EqAll(params Subquery) NonScalarOperation

func (Column) EqAny

func (c Column) EqAny(params Subquery) NonScalarOperation

func (Column) Gt

func (Column) GtAll

func (c Column) GtAll(params Subquery) NonScalarOperation

func (Column) GtAny

func (c Column) GtAny(params Subquery) NonScalarOperation

func (Column) Gte

func (Column) GteAll

func (c Column) GteAll(params Subquery) NonScalarOperation

func (Column) GteAny

func (c Column) GteAny(params Subquery) NonScalarOperation

func (Column) In

func (c Column) In(params ValsOrSub) ContainingOperation

func (Column) IsNotNull

func (c Column) IsNotNull() NullOperation

func (Column) IsNull

func (c Column) IsNull() NullOperation

func (Column) Like

func (Column) Lt

func (Column) LtAll

func (c Column) LtAll(params Subquery) NonScalarOperation

func (Column) LtAny

func (c Column) LtAny(params Subquery) NonScalarOperation

func (Column) Lte

func (Column) LteAll

func (c Column) LteAll(params Subquery) NonScalarOperation

func (Column) LteAny

func (c Column) LteAny(params Subquery) NonScalarOperation

func (Column) NotEq

func (Column) NotEqAll

func (c Column) NotEqAll(params Subquery) NonScalarOperation

func (Column) NotEqAny

func (c Column) NotEqAny(params Subquery) NonScalarOperation

func (Column) NotIn

func (c Column) NotIn(params ValsOrSub) ContainingOperation

func (Column) RegExp

type ColumnAlias

type ColumnAlias struct {
	Alias string
	// contains filtered or unexported fields
}

func NewColumnAlias

func NewColumnAlias(alias string) ColumnAlias

type ComparisonOperation

type ComparisonOperation struct {
	// contains filtered or unexported fields
}

type ComparisonOrLogicalOperation

type ComparisonOrLogicalOperation interface {
	Statement
	// contains filtered or unexported methods
}

type ContainingOperation

type ContainingOperation struct {
	// contains filtered or unexported fields
}

func NewIn

func NewIn(vals ValsOrSub) ContainingOperation

func NewNotIn

func NewNotIn(vals ValsOrSub) ContainingOperation

type CreateTable

type CreateTable struct {
	// contains filtered or unexported fields
}

func NewCreateTable

func NewCreateTable(joiner Joiner) CreateTable

func NewCreateTableIfNotExists

func NewCreateTableIfNotExists(joiner Joiner) CreateTable

func (CreateTable) Definitions

func (c CreateTable) Definitions(defs ...Definition) Definitions

type DefaultValues

type DefaultValues struct {
	// contains filtered or unexported fields
}

func NewDefaultValues

func NewDefaultValues() DefaultValues

type Definition

type Definition struct {
	// contains filtered or unexported fields
}

func NewDefinition

func NewDefinition(definition string) Definition

type Definitions

type Definitions struct {
	// contains filtered or unexported fields
}

func NewDefinitions

func NewDefinitions(definitions ...Definition) Definitions

type Delete

type Delete struct {
	// contains filtered or unexported fields
}

func NewDelete

func NewDelete(tables ...Table) Delete

func (Delete) From

func (d Delete) From(t JoinerOrAlias) From

type ExistanceOperation

type ExistanceOperation struct {
	// contains filtered or unexported fields
}

func NewExists

func NewExists(sub Subquery) ExistanceOperation

func NewNotExists

func NewNotExists(sub Subquery) ExistanceOperation

type FSP

type FSP string
const (
	FSP0 FSP = "0"
	FSP1 FSP = "1"
	FSP2 FSP = "2"
	FSP3 FSP = "3"
	FSP4 FSP = "4"
	FSP5 FSP = "5"
	FSP6 FSP = "6"
)

type Formula

type Formula struct {
	// contains filtered or unexported fields
}

func NewAdd

func NewAdd(numeric ...ValOrColOrSubOrFormula) Formula

func NewDiv

func NewDiv(numeric ...ValOrColOrSubOrFormula) Formula

func NewIntegerDiv

func NewIntegerDiv(numeric ...ValOrColOrSubOrFormula) Formula

func NewMod

func NewMod(numeric ...ValOrColOrSubOrFormula) Formula

func NewMul

func NewMul(numeric ...ValOrColOrSubOrFormula) Formula

func NewSub

func NewSub(numeric ...ValOrColOrSubOrFormula) Formula

type From

type From struct {
	// contains filtered or unexported fields
}

func NewFrom

func NewFrom(table JoinerOrAlias) From

func (From) GroupBy

func (f From) GroupBy(col Column, columns ...Column) GroupBy

func (From) Limit

func (f From) Limit(count int) Limit

func (From) OrderBy

func (f From) OrderBy(orders ...Order) OrderBy

func (From) Where

type Fromer

type Fromer interface {
	From(table JoinerOrAlias) From
}

type Func

type Func struct {
	// contains filtered or unexported fields
}

func NewAdddate

func NewAdddate(date ValOrColOrFuncOrSub, interval IntervalUnit) Func

func NewAddtime

func NewAddtime(date1, date2 ValOrColOrFuncOrSub) Func

func NewConcat

func NewConcat(strs ...ValOrColOrFuncOrSub) Func

func NewConvertTz

func NewConvertTz(date, from, to ValOrColOrFuncOrSub) Func

func NewCount

func NewCount(col ValOrColOrFuncOrSub) Func

func NewCurDate

func NewCurDate() Func

func NewCurrentDate

func NewCurrentDate() Func

func NewCurrentTime

func NewCurrentTime(fsp FSP) Func

func NewCurrentTimestamp

func NewCurrentTimestamp(fsp FSP) Func

func NewCurtime

func NewCurtime(fsp FSP) Func

func NewDate

func NewDate(date ValOrColOrFuncOrSub) Func

func NewDateAdd

func NewDateAdd(date ValOrColOrFuncOrSub, interval IntervalUnit) Func

func NewDateFormat

func NewDateFormat(date, format ValOrColOrFuncOrSub) Func

func NewDateSub

func NewDateSub(date ValOrColOrFuncOrSub, interval IntervalUnit) Func

func NewDatediff

func NewDatediff(date1, date2 ValOrColOrFuncOrSub) Func

func NewDay

func NewDay(date ValOrColOrFuncOrSub) Func

func NewDayname

func NewDayname(date ValOrColOrFuncOrSub) Func

func NewDayofmonth

func NewDayofmonth(date ValOrColOrFuncOrSub) Func

func NewDayofweek

func NewDayofweek(date ValOrColOrFuncOrSub) Func

func NewDayofyear

func NewDayofyear(date ValOrColOrFuncOrSub) Func

func NewExtract

func NewExtract(date ValOrColOrFuncOrSub) Func

func NewFromDays

func NewFromDays(days ValOrColOrFuncOrSub) Func

func NewFromUnixtime

func NewFromUnixtime(utime, format ValOrColOrFuncOrSub) Func

func NewGetFormat

func NewGetFormat(typ, name ValOrColOrFuncOrSub) Func

func NewHour

func NewHour(time ValOrColOrFuncOrSub) Func

func NewIFNULL

func NewIFNULL(expr1, expr2 ValOrColOrFuncOrSub) Func

func NewLastDay

func NewLastDay(date ValOrColOrFuncOrSub) Func

func NewLocaltime

func NewLocaltime(fsp FSP) Func

func NewLocaltimestamp

func NewLocaltimestamp(fsp FSP) Func

func NewMakedate

func NewMakedate(year, days ValOrColOrFuncOrSub) Func

func NewMaketime

func NewMaketime(hours, minutes, seconds ValOrColOrFuncOrSub) Func

func NewMax

func NewMax(col ValOrColOrFuncOrSub) Func

func NewMicrosecond

func NewMicrosecond(date ValOrColOrFuncOrSub) Func

func NewMinute

func NewMinute(date ValOrColOrFuncOrSub) Func

func NewMonth

func NewMonth(date ValOrColOrFuncOrSub) Func

func NewMonthname

func NewMonthname(date ValOrColOrFuncOrSub) Func

func NewNow

func NewNow(fsp FSP) Func

func NewPeriodAdd

func NewPeriodAdd(period, value ValOrColOrFuncOrSub) Func

func NewPeriodDiff

func NewPeriodDiff(period1, period2 ValOrColOrFuncOrSub) Func

func NewQuarter

func NewQuarter(date ValOrColOrFuncOrSub) Func

func NewSecToTime

func NewSecToTime(seconds ValOrColOrFuncOrSub) Func

func NewSecond

func NewSecond(time ValOrColOrFuncOrSub) Func

func NewStrToDate

func NewStrToDate(str, format ValOrColOrFuncOrSub) Func

func NewSubdate

func NewSubdate(date ValOrColOrFuncOrSub, interval IntervalUnit) Func

func NewSubtime

func NewSubtime(date1, date2 ValOrColOrFuncOrSub) Func

func NewSysdate

func NewSysdate(fsp FSP) Func

func NewTime

func NewTime(date ValOrColOrFuncOrSub) Func

func NewTimeFormat

func NewTimeFormat(time, format ValOrColOrFuncOrSub) Func

func NewTimeToSec

func NewTimeToSec(time ValOrColOrFuncOrSub) Func

func NewTimediff

func NewTimediff(date1, date2 ValOrColOrFuncOrSub) Func

func NewTimestamp

func NewTimestamp(date1, date2 ValOrColOrFuncOrSub) Func

func NewTimestampadd

func NewTimestampadd(unit, interval, date ValOrColOrFuncOrSub) Func

func NewTimestampdiff

func NewTimestampdiff(unit, date1, date2 ValOrColOrFuncOrSub) Func

func NewToDays

func NewToDays(date ValOrColOrFuncOrSub) Func

func NewToSeconds

func NewToSeconds(date ValOrColOrFuncOrSub) Func

func NewUnixTimestamp

func NewUnixTimestamp(date ValOrColOrFuncOrSub) Func

func NewUtcDate

func NewUtcDate() Func

func NewUtcTime

func NewUtcTime(fsp FSP) Func

func NewUtcTimestamp

func NewUtcTimestamp(fsp FSP) Func

func NewWeek

func NewWeek(date, mode ValOrColOrFuncOrSub) Func

func NewWeekday

func NewWeekday(date ValOrColOrFuncOrSub) Func

func NewWeekofyear

func NewWeekofyear(date ValOrColOrFuncOrSub) Func

func NewYear

func NewYear(date ValOrColOrFuncOrSub) Func

func NewYearweek

func NewYearweek(date, mode ValOrColOrFuncOrSub) Func

func (Func) Between

func (c Func) Between(from, to ValOrColOrFuncOrSub) Between

func (Func) Eq

func (Func) EqAll

func (c Func) EqAll(arg Subquery) NonScalarOperation

func (Func) EqAny

func (c Func) EqAny(arg Subquery) NonScalarOperation

func (Func) Gt

func (Func) GtAll

func (c Func) GtAll(arg Subquery) NonScalarOperation

func (Func) GtAny

func (c Func) GtAny(arg Subquery) NonScalarOperation

func (Func) Gte

func (Func) GteAll

func (c Func) GteAll(arg Subquery) NonScalarOperation

func (Func) GteAny

func (c Func) GteAny(arg Subquery) NonScalarOperation

func (Func) In

func (Func) Like

func (Func) Lt

func (Func) LtAll

func (c Func) LtAll(arg Subquery) NonScalarOperation

func (Func) LtAny

func (c Func) LtAny(arg Subquery) NonScalarOperation

func (Func) Lte

func (Func) LteAll

func (c Func) LteAll(arg Subquery) NonScalarOperation

func (Func) LteAny

func (c Func) LteAny(arg Subquery) NonScalarOperation

func (Func) NotEq

func (Func) NotEqAll

func (c Func) NotEqAll(arg Subquery) NonScalarOperation

func (Func) NotEqAny

func (c Func) NotEqAny(arg Subquery) NonScalarOperation

func (Func) NotIn

func (c Func) NotIn(arg ValsOrSub) ContainingOperation

func (Func) RegExp

type GroupBy

type GroupBy struct {
	// contains filtered or unexported fields
}

func NewGroupBy

func NewGroupBy(column Column, columns ...Column) GroupBy

func (GroupBy) Having

func (g GroupBy) Having(operation ComparisonOrLogicalOperation) Having

func (GroupBy) Limit

func (g GroupBy) Limit(count int) Limit

func (GroupBy) OrderBy

func (g GroupBy) OrderBy(orders ...Order) OrderBy

type GroupByer

type GroupByer interface {
	GroupBy(col Column, columns ...Column) GroupBy
}

type Having

type Having struct {
	// contains filtered or unexported fields
}

func NewHaving

func NewHaving(operation ComparisonOrLogicalOperation) Having

func (Having) Limit

func (h Having) Limit(count int) Limit

func (Having) OrderBy

func (h Having) OrderBy(orders ...Order) OrderBy

type InsertInto

type InsertInto struct {
	// contains filtered or unexported fields
}

func NewInsertInto

func NewInsertInto(table Table, columns ...Column) InsertInto

func (InsertInto) DefaultValues

func (i InsertInto) DefaultValues() DefaultValues

func (InsertInto) Select

func (InsertInto) Values

func (i InsertInto) Values(paramses ...Vals) Values

type Interval

type Interval struct {
	// contains filtered or unexported fields
}

func NewInterval

func NewInterval(duration ValOrColOrFuncOrSub) Interval

func (Interval) Day

func (i Interval) Day() IntervalUnit

func (Interval) DayHour

func (i Interval) DayHour() IntervalUnit

func (Interval) DayMicrosecond

func (i Interval) DayMicrosecond() IntervalUnit

func (Interval) DayMinute

func (i Interval) DayMinute() IntervalUnit

func (Interval) DaySecond

func (i Interval) DaySecond() IntervalUnit

func (Interval) Hour

func (i Interval) Hour() IntervalUnit

func (Interval) HourMicrosecond

func (i Interval) HourMicrosecond() IntervalUnit

func (Interval) HourMinute

func (i Interval) HourMinute() IntervalUnit

func (Interval) HourSecond

func (i Interval) HourSecond() IntervalUnit

func (Interval) Microsecond

func (i Interval) Microsecond() IntervalUnit

func (Interval) Minute

func (i Interval) Minute() IntervalUnit

func (Interval) MinuteMicrosecond

func (i Interval) MinuteMicrosecond() IntervalUnit

func (Interval) MinuteSecond

func (i Interval) MinuteSecond() IntervalUnit

func (Interval) Month

func (i Interval) Month() IntervalUnit

func (Interval) Quarter

func (i Interval) Quarter() IntervalUnit

func (Interval) Second

func (i Interval) Second() IntervalUnit

func (Interval) SecondMicrosecond

func (i Interval) SecondMicrosecond() IntervalUnit

func (Interval) Week

func (i Interval) Week() IntervalUnit

func (Interval) Year

func (i Interval) Year() IntervalUnit

func (Interval) YearMonth

func (i Interval) YearMonth() IntervalUnit

type IntervalUnit

type IntervalUnit struct {
	// contains filtered or unexported fields
}

type Join

type Join struct {
	// contains filtered or unexported fields
}

func NewInnerJoin

func NewInnerJoin(table TableOrAlias) Join

func NewJoin

func NewJoin(table TableOrAlias) Join

func NewLeftJoin

func NewLeftJoin(table TableOrAlias) Join

func NewRightJoin

func NewRightJoin(table TableOrAlias) Join

func (Join) InnerJoin

func (j Join) InnerJoin(table TableOrAlias) Join

func (Join) Join

func (j Join) Join(table TableOrAlias) Join

func (Join) LeftJoin

func (j Join) LeftJoin(table TableOrAlias) Join

func (Join) On

func (j Join) On(column1, column2 Column) On

func (Join) RightJoin

func (j Join) RightJoin(table TableOrAlias) Join

func (Join) Using

func (j Join) Using(col Column) Using

type JoinOperation

type JoinOperation struct {
	// contains filtered or unexported fields
}

type Joiner

type Joiner interface {
	Statement
	Join(TableOrAlias) Join
	InnerJoin(TableOrAlias) Join
	LeftJoin(TableOrAlias) Join
	RightJoin(TableOrAlias) Join
}

type JoinerOrAlias

type JoinerOrAlias interface {
	Statement
	// contains filtered or unexported methods
}

type Limit

type Limit struct {
	// contains filtered or unexported fields
}

func NewLimit

func NewLimit(count int) Limit

func (Limit) Offset

func (l Limit) Offset(count int) Offset

type Limiter

type Limiter interface {
	Limit(count int) Limit
}

type Namer

type Namer interface {
	Statement
	// contains filtered or unexported methods
}

type NonScalarOperation

type NonScalarOperation struct {
	// contains filtered or unexported fields
}

func NewEqAll

func NewEqAll(sub Subquery) NonScalarOperation

func NewEqAny

func NewEqAny(sub Subquery) NonScalarOperation

func NewGtAll

func NewGtAll(sub Subquery) NonScalarOperation

func NewGtAny

func NewGtAny(sub Subquery) NonScalarOperation

func NewGteAll

func NewGteAll(sub Subquery) NonScalarOperation

func NewGteAny

func NewGteAny(sub Subquery) NonScalarOperation

func NewLtAll

func NewLtAll(sub Subquery) NonScalarOperation

func NewLtAny

func NewLtAny(sub Subquery) NonScalarOperation

func NewLteAll

func NewLteAll(sub Subquery) NonScalarOperation

func NewLteAny

func NewLteAny(sub Subquery) NonScalarOperation

func NewNotEqAll

func NewNotEqAll(sub Subquery) NonScalarOperation

func NewNotEqAny

func NewNotEqAny(sub Subquery) NonScalarOperation

type Not

type Not struct {
	// contains filtered or unexported fields
}

func NewNot

func NewNot(operation ComparisonOrLogicalOperation) Not

type NullOperation

type NullOperation struct {
	// contains filtered or unexported fields
}

func NewIsNotNull

func NewIsNotNull() NullOperation

func NewIsNull

func NewIsNull() NullOperation

type Offset

type Offset struct {
	// contains filtered or unexported fields
}

Offset skips specified rows before beginning to return rows.

func NewOffset

func NewOffset(count int) Offset

NewOffset return a new Offset.

type Offsetter

type Offsetter interface {
	Offset(count int) Offset
}

type On

type On struct {
	// contains filtered or unexported fields
}

func NewOn

func NewOn(column1, column2 Column) On

func (On) InnerJoin

func (o On) InnerJoin(table TableOrAlias) Join

func (On) Join

func (o On) Join(table TableOrAlias) Join

func (On) LeftJoin

func (o On) LeftJoin(table TableOrAlias) Join

func (On) RightJoin

func (o On) RightJoin(table TableOrAlias) Join

type Order

type Order struct {
	// contains filtered or unexported fields
}

func NewAsc

func NewAsc() Order

func NewDesc

func NewDesc() Order

type OrderBy

type OrderBy struct {
	// contains filtered or unexported fields
}

func NewOrderBy

func NewOrderBy(os ...Order) OrderBy

func (OrderBy) Limit

func (o OrderBy) Limit(count int) Limit

type OrderByer

type OrderByer interface {
	OrderBy(orders ...Order) OrderBy
}

type Prever

type Prever interface {
	// contains filtered or unexported methods
}

type SearchedCase

type SearchedCase struct {
	// contains filtered or unexported fields
}

func NewSearchedCase

func NewSearchedCase(thenOrElse SearchedThenOrElse) SearchedCase

type SearchedElse

type SearchedElse struct {
	// contains filtered or unexported fields
}

func NewSearchedElse

func NewSearchedElse(param ValOrColOrFuncOrSub) SearchedElse

type SearchedThen

type SearchedThen struct {
	// contains filtered or unexported fields
}

func NewSearchedThen

func NewSearchedThen(param ValOrColOrFuncOrSub) SearchedThen

func (SearchedThen) Else

func (SearchedThen) When

type SearchedThenOrElse

type SearchedThenOrElse interface {
	Statement
	// contains filtered or unexported methods
}

type SearchedWhen

type SearchedWhen struct {
	// contains filtered or unexported fields
}

func NewSearchedWhen

func NewSearchedWhen(condition ComparisonOrLogicalOperation) SearchedWhen

func (SearchedWhen) Then

type Select

type Select struct {
	// contains filtered or unexported fields
}

func NewSelect

func NewSelect(columns ...ValOrColOrAliasOrFuncOrSubOrFormula) Select

func NewSelectDistinct

func NewSelectDistinct(columns ...ValOrColOrAliasOrFuncOrSubOrFormula) Select

func (Select) From

func (s Select) From(t JoinerOrAlias) From

type Selector

type Selector interface {
	Select(columns ...ValOrColOrAliasOrFuncOrSubOrFormula) Select
}

type Set

type Set struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet(assigns ...Assign) Set

func (Set) Where

func (s Set) Where(operation ComparisonOrLogicalOperation) Where

type SetOperation

type SetOperation struct {
	// contains filtered or unexported fields
}

func NewExcept

func NewExcept(stmts ...Statement) SetOperation

func NewExceptAll

func NewExceptAll(stmts ...Statement) SetOperation

func NewIntersect

func NewIntersect(stmts ...Statement) SetOperation

func NewIntersectAll

func NewIntersectAll(stmts ...Statement) SetOperation

func NewUnion

func NewUnion(stmts ...Statement) SetOperation

func NewUnionAll

func NewUnionAll(stmts ...Statement) SetOperation

func (SetOperation) OrderBy

func (u SetOperation) OrderBy(os ...Order) OrderBy

type SimpleCase

type SimpleCase struct {
	// contains filtered or unexported fields
}

func NewSimpleCase

func NewSimpleCase(param ValOrColOrFuncOrSub, thenOrElse SimpleThenOrElse) SimpleCase

type SimpleElse

type SimpleElse struct {
	// contains filtered or unexported fields
}

func NewSimpleElse

func NewSimpleElse(param ValOrColOrFuncOrSub) SimpleElse

type SimpleThen

type SimpleThen struct {
	// contains filtered or unexported fields
}

func NewSimpleThen

func NewSimpleThen(param ValOrColOrFuncOrSub) SimpleThen

func (SimpleThen) Else

func (SimpleThen) When

func (t SimpleThen) When(param Val) SimpleWhen

type SimpleThenOrElse

type SimpleThenOrElse interface {
	Statement
	// contains filtered or unexported methods
}

type SimpleWhen

type SimpleWhen struct {
	// contains filtered or unexported fields
}

func NewSimpleWhen

func NewSimpleWhen(param Val) SimpleWhen

func (SimpleWhen) Then

type Statement

type Statement interface {
	// contains filtered or unexported methods
}

Statement is the interface of the component which is the minimum unit constituting SQL. All types that implement this interface can be built as SQL.

type Subquery

type Subquery struct {
	// contains filtered or unexported fields
}

func NewSubquery

func NewSubquery(stmt Statement) Subquery

func (Subquery) As

func (s Subquery) As(alias string) SubqueryAlias

func (Subquery) Between

func (s Subquery) Between(from, to ValOrColOrFuncOrSub) Between

func (Subquery) Eq

func (Subquery) Gt

func (Subquery) Gte

func (Subquery) In

func (s Subquery) In(params ValsOrSub) ContainingOperation

func (Subquery) InnerJoin

func (s Subquery) InnerJoin(table TableOrAlias) Join

func (Subquery) IsNotNull

func (s Subquery) IsNotNull() NullOperation

func (Subquery) IsNull

func (s Subquery) IsNull() NullOperation

func (Subquery) Join

func (s Subquery) Join(table TableOrAlias) Join

func (Subquery) LeftJoin

func (s Subquery) LeftJoin(table TableOrAlias) Join

func (Subquery) Like

func (Subquery) Lt

func (Subquery) Lte

func (Subquery) NotEq

func (Subquery) NotIn

func (s Subquery) NotIn(params ValsOrSub) ContainingOperation

func (Subquery) RegExp

func (Subquery) RightJoin

func (s Subquery) RightJoin(table TableOrAlias) Join

type SubqueryAlias

type SubqueryAlias struct {
	Alias string
	// contains filtered or unexported fields
}

func NewSubqueryAlias

func NewSubqueryAlias(alias string) SubqueryAlias

func (SubqueryAlias) InnerJoin

func (a SubqueryAlias) InnerJoin(table TableOrAlias) Join

func (SubqueryAlias) Join

func (a SubqueryAlias) Join(table TableOrAlias) Join

func (SubqueryAlias) LeftJoin

func (a SubqueryAlias) LeftJoin(table TableOrAlias) Join

func (SubqueryAlias) RightJoin

func (a SubqueryAlias) RightJoin(table TableOrAlias) Join

type Table

type Table struct {
	Name string
}

func NewTable

func NewTable(name string) Table

func (Table) As

func (t Table) As(alias string) TableAlias

func (Table) Column

func (t Table) Column(name string) Column

func (Table) InnerJoin

func (t Table) InnerJoin(table TableOrAlias) Join

func (Table) Join

func (t Table) Join(table TableOrAlias) Join

func (Table) LeftJoin

func (t Table) LeftJoin(table TableOrAlias) Join

func (Table) RightJoin

func (t Table) RightJoin(table TableOrAlias) Join

type TableAlias

type TableAlias struct {
	Alias string
	// contains filtered or unexported fields
}

func NewTableAlias

func NewTableAlias(alias string) TableAlias

func (TableAlias) Column

func (t TableAlias) Column(name string) Column

func (TableAlias) InnerJoin

func (t TableAlias) InnerJoin(table TableOrAlias) Join

func (TableAlias) Join

func (t TableAlias) Join(table TableOrAlias) Join

func (TableAlias) LeftJoin

func (t TableAlias) LeftJoin(table TableOrAlias) Join

func (TableAlias) RightJoin

func (t TableAlias) RightJoin(table TableOrAlias) Join

type TableOrAlias

type TableOrAlias interface {
	Statement
	// contains filtered or unexported methods
}

type Update

type Update struct {
	// contains filtered or unexported fields
}

func NewUpdate

func NewUpdate(table Table) Update

func (Update) Set

func (u Update) Set(assigns ...Assign) Set

type Using

type Using struct {
	// contains filtered or unexported fields
}

func NewUsing

func NewUsing(column Column) Using

func (Using) InnerJoin

func (u Using) InnerJoin(table TableOrAlias) Join

func (Using) Join

func (u Using) Join(table TableOrAlias) Join

func (Using) LeftJoin

func (u Using) LeftJoin(table TableOrAlias) Join

func (Using) RightJoin

func (u Using) RightJoin(table TableOrAlias) Join

type Val

type Val struct {
	// contains filtered or unexported fields
}

func NewVal

func NewVal(value interface{}) Val

type ValOrColOrAliasOrFuncOrSubOrFormula

type ValOrColOrAliasOrFuncOrSubOrFormula interface {
	Statement
	// contains filtered or unexported methods
}

type ValOrColOrFuncOrSub

type ValOrColOrFuncOrSub interface {
	Statement
	// contains filtered or unexported methods
}

type ValOrColOrFuncOrSubs

type ValOrColOrFuncOrSubs []ValOrColOrFuncOrSub

func (ValOrColOrFuncOrSubs) ToArgs

func (vs ValOrColOrFuncOrSubs) ToArgs() Args

type ValOrColOrSubOrFormula

type ValOrColOrSubOrFormula interface {
	Statement
	// contains filtered or unexported methods
}

type ValOrFuncOrSub

type ValOrFuncOrSub interface {
	Statement
	// contains filtered or unexported methods
}

type Vals

type Vals []Val

func NewVals

func NewVals(values ...interface{}) Vals

type ValsOrSub

type ValsOrSub interface {
	Statement
	// contains filtered or unexported methods
}

type Values

type Values struct {
	// contains filtered or unexported fields
}

func NewValues

func NewValues(valses ...Vals) Values

type Where

type Where struct {
	// contains filtered or unexported fields
}

func NewWhere

func NewWhere(operation ComparisonOrLogicalOperation) Where

func (Where) GroupBy

func (w Where) GroupBy(column Column, columns ...Column) GroupBy

func (Where) Limit

func (w Where) Limit(count int) Limit

func (Where) OrderBy

func (w Where) OrderBy(orders ...Order) OrderBy

type Wherer

type Wherer interface {
	Where(op ComparisonOrLogicalOperation) Where
}

type Wildcard

type Wildcard struct{}

func NewWildcard

func NewWildcard() Wildcard

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL