Documentation ¶
Overview ¶
Package ast provides AST nodes definitions.
The definitions of ASTs are based on the following document.
- <https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language>
- <https://cloud.google.com/spanner/docs/query-syntax>
Each `Node`'s documentation describes its syntax (SQL representation) in a `text/template` fashion with thw following custom functions.
- `sql node`: Returns the SQL representation of `node`.
- `sqlOpt node`: Like `sql node`, but returns the empty string if `node` is `nil`.
- `sqlJoin sep nodes`: Concatenates the SQL representations of `nodes` with `sep`.
- `sqlIdentQuote x`: Quotes the given identifier string if needed.
- `sqlStringQuote s`: Returns the SQL quoted string of `s`.
- `sqlBytesQuote bs`: Returns the SQL quotes bytes of `bs`.
- `isnil v`: Checks whether `v` is `nil` or others.
Each `Node`s documentation has `pos` and `end` information using the following EBNF.
PosChoice -> PosExpr ("||" PosExpr)* PosExpr -> PosAtom ("+" IntAtom)? PosAtom -> PosVar | NodeExpr "." ("pos" | "end") NodeExpr -> NodeAtom | "(" NodeAtom ("??" NodeAtom)* ")" NodeAtom -> NodeVar | NodeSliceVar "[" (IntAtom | "$") "]" IntAtom -> IntVal | "len" "(" StringVar ")" | "(" BoolVar "?" IntAtom ":" IntAtom ")" IntVal -> "0" | "1" | ... (PosVar, NodeVar, NodeSliceVar, and BoolVar are derived by its `struct` definition.)
Index ¶
- type AddColumn
- type AddRowDeletionPolicy
- type AddStoredColumn
- type AddTableConstraint
- type Alias
- type AlterChangeStream
- type AlterColumn
- type AlterColumnSet
- type AlterIndex
- type AlterTable
- type Arg
- type ArrayLiteral
- type ArraySchemaType
- type ArraySubQuery
- type ArrayType
- type AsAlias
- type AtTimeZone
- type BetweenExpr
- type BinaryExpr
- type BinaryOp
- type BoolLiteral
- type BytesLiteral
- type CTE
- type CallExpr
- type CaseElse
- type CaseExpr
- type CaseWhen
- type CastExpr
- type CastIntValue
- type CastNumValue
- type ChangeStreamAlteration
- type ChangeStreamDropForAll
- type ChangeStreamFor
- type ChangeStreamForAll
- type ChangeStreamForTable
- type ChangeStreamForTables
- type ChangeStreamOptions
- type ChangeStreamOptionsRecord
- type ChangeStreamSetFor
- type ChangeStreamSetOptions
- type Check
- type Cluster
- type Collate
- type ColumnDef
- type ColumnDefOptions
- type ColumnDefaultExpr
- type CompoundQuery
- type Constraint
- type CountStarExpr
- type CreateChangeStream
- type CreateDatabase
- type CreateIndex
- type CreateRole
- type CreateRowDeletionPolicy
- type CreateSequence
- type CreateTable
- type CreateView
- type DDL
- type DML
- type DateLiteral
- type DefaultExpr
- type Delete
- type DeletePrivilege
- type Direction
- type DotStar
- type DropChangeStream
- type DropColumn
- type DropConstraint
- type DropIndex
- type DropRole
- type DropRowDeletionPolicy
- type DropStoredColumn
- type DropTable
- type ExecutePrivilegeOnTableFunction
- type ExistsSubQuery
- type Expr
- type ExprArg
- type ExprSelectItem
- type ExtractExpr
- type FloatLiteral
- type ForeignKey
- type From
- type GeneratedColumnExpr
- type Grant
- type GroupBy
- type Having
- type Hint
- type HintRecord
- type Ident
- type InCondition
- type InExpr
- type IndexAlteration
- type IndexExpr
- type IndexKey
- type Insert
- type InsertInput
- type InsertOrType
- type InsertPrivilege
- type IntLiteral
- type IntValue
- type InterleaveIn
- type IntervalArg
- type IsBoolExpr
- type IsNullExpr
- type Join
- type JoinCondition
- type JoinHintKey
- type JoinMethod
- type JoinOp
- type Limit
- type Node
- type NullLiteral
- type NumValue
- type NumericLiteral
- type Offset
- type On
- type OnDeleteAction
- type OrderBy
- type OrderByItem
- type Param
- type ParenExpr
- type ParenTableExpr
- type Path
- type Privilege
- type PrivilegeOnTable
- type QueryExpr
- type QueryStatement
- type ReplaceRowDeletionPolicy
- type Revoke
- type RolePrivilege
- type RowDeletionPolicy
- type ScalarSchemaType
- type ScalarSubQuery
- type ScalarTypeName
- type SchemaType
- type SecurityType
- type Select
- type SelectItem
- type SelectPrivilege
- type SelectPrivilegeOnView
- type SelectorExpr
- type SequenceArg
- type SequenceOption
- type SetOnDelete
- type SetOp
- type SimpleType
- type SizedSchemaType
- type Star
- type Statement
- type Storing
- type StringLiteral
- type StringValue
- type StructField
- type StructLiteral
- type StructType
- type SubQuery
- type SubQueryInCondition
- type SubQueryInput
- type SubQueryTableExpr
- type TableAlteration
- type TableConstraint
- type TableExpr
- type TableHintKey
- type TableName
- type TablePrivilege
- type TableSample
- type TableSampleMethod
- type TableSampleSize
- type TableSampleUnit
- type TimestampLiteral
- type Type
- type UnaryExpr
- type UnaryOp
- type Unnest
- type UnnestInCondition
- type Update
- type UpdateItem
- type UpdatePrivilege
- type Using
- type ValuesInCondition
- type ValuesInput
- type ValuesRow
- type Where
- type With
- type WithOffset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddColumn ¶
type AddColumn struct { Add token.Pos // position of "ADD" keyword IfNotExists bool Column *ColumnDef }
AddColumn is ADD COLUMN clause in ALTER TABLE.
ADD COLUMN {{if .IfNotExists}}IF NOT EXISTS{{end}} {{.Column | sql}}
type AddRowDeletionPolicy ¶
type AddRowDeletionPolicy struct { Add token.Pos // position of "ADD" keyword RowDeletionPolicy *RowDeletionPolicy }
AddRowDeletionPolicy is ADD ROW DELETION POLICY clause in ALTER TABLE.
ADD {{.RowDeletionPolicy | sql}}
func (*AddRowDeletionPolicy) End ¶
func (a *AddRowDeletionPolicy) End() token.Pos
func (*AddRowDeletionPolicy) Pos ¶
func (a *AddRowDeletionPolicy) Pos() token.Pos
func (*AddRowDeletionPolicy) SQL ¶
func (a *AddRowDeletionPolicy) SQL() string
type AddStoredColumn ¶
AddStoredColumn is ADD STORED COLUMN clause in ALTER INDEX.
ADD STORED COLUMN {{.Name | sql}}
func (*AddStoredColumn) End ¶
func (a *AddStoredColumn) End() token.Pos
func (*AddStoredColumn) Pos ¶
func (a *AddStoredColumn) Pos() token.Pos
func (*AddStoredColumn) SQL ¶
func (a *AddStoredColumn) SQL() string
type AddTableConstraint ¶
type AddTableConstraint struct { Add token.Pos // position of "ADD" keyword TableConstraint *TableConstraint }
AddTableConstraint is ADD table_constraint clause in ALTER TABLE.
ADD {{.TableConstraint}}
func (*AddTableConstraint) End ¶
func (a *AddTableConstraint) End() token.Pos
func (*AddTableConstraint) Pos ¶
func (a *AddTableConstraint) Pos() token.Pos
func (*AddTableConstraint) SQL ¶
func (a *AddTableConstraint) SQL() string
type Alias ¶
Alias is aliased expression by AS clause in SELECT result columns list.
{{.Expr | sql}} {{.As | sql}}
type AlterChangeStream ¶
type AlterChangeStream struct { Alter token.Pos // position of "ALTER" keyword Name *Ident ChangeStreamAlteration ChangeStreamAlteration }
AlterChangeStream is ALTER CHANGE STREAM statement node.
ALTER CHANGE STREAM {{.Name | sql}} {{.ChangeStreamAlteration | sql}}
func (*AlterChangeStream) End ¶
func (a *AlterChangeStream) End() token.Pos
func (*AlterChangeStream) Pos ¶
func (a *AlterChangeStream) Pos() token.Pos
func (*AlterChangeStream) SQL ¶
func (a *AlterChangeStream) SQL() string
type AlterColumn ¶
type AlterColumn struct { // pos = Alter // end = DefaultExpr.end || Null + 4 || Type.end Alter token.Pos // position of "ALTER" keyword Null token.Pos // position of "NULL" Name *Ident Type SchemaType NotNull bool DefaultExpr *ColumnDefaultExpr }
AlterColumn is ALTER COLUMN clause in ALTER TABLE.
ALTER COLUMN {{.Name | sql}} {{.Type | sql}} {{if .NotNull}}NOT NULL{{end}} {{.DefaultExpr | sqlOpt}}
func (*AlterColumn) End ¶
func (a *AlterColumn) End() token.Pos
func (*AlterColumn) Pos ¶
func (a *AlterColumn) Pos() token.Pos
func (*AlterColumn) SQL ¶
func (a *AlterColumn) SQL() string
type AlterColumnSet ¶
type AlterColumnSet struct { Alter token.Pos // position of "ALTER" keyword Name *Ident Options *ColumnDefOptions DefaultExpr *ColumnDefaultExpr }
AlterColumnSet is ALTER COLUMN SET clause in ALTER TABLE.
ALTER COLUMN {{.Name | sql}} SET {{if .Options}}{{.Options | sql}}{{else}}{{.DefaultExpr | sql}}{{end}}
func (*AlterColumnSet) End ¶
func (a *AlterColumnSet) End() token.Pos
func (*AlterColumnSet) Pos ¶
func (a *AlterColumnSet) Pos() token.Pos
func (*AlterColumnSet) SQL ¶
func (a *AlterColumnSet) SQL() string
type AlterIndex ¶
type AlterIndex struct { Alter token.Pos // position of "ALTER" keyword Name *Ident IndexAlteration IndexAlteration }
AlterIndex is ALTER INDEX statement node.
ALTER INDEX {{.Name | sql}} {{.IndexAlteration | sql}}
func (*AlterIndex) End ¶
func (a *AlterIndex) End() token.Pos
func (*AlterIndex) Pos ¶
func (a *AlterIndex) Pos() token.Pos
func (*AlterIndex) SQL ¶
func (a *AlterIndex) SQL() string
type AlterTable ¶
type AlterTable struct { Alter token.Pos // position of "ALTER" keyword Name *Ident TableAlteration TableAlteration }
AlterTable is ALTER TABLE statement node.
ALTER TABLE {{.Name | sql}} {{.TableAlteration | sql}}
func (*AlterTable) End ¶
func (a *AlterTable) End() token.Pos
func (*AlterTable) Pos ¶
func (a *AlterTable) Pos() token.Pos
func (*AlterTable) SQL ¶
func (a *AlterTable) SQL() string
type Arg ¶
type Arg interface { Node // contains filtered or unexported methods }
Arg represents argument of function call.
type ArrayLiteral ¶
type ArrayLiteral struct { Array token.Pos // position of "ARRAY" keyword Lbrack, Rbrack token.Pos // position of "[" and "]" Type Type // optional Values []Expr }
AraryLiteral is array literal node.
ARRAY{{if .Type}}<{{.Type | sql}}>{{end}}[{{.Values | sqlJoin ","}}]
func (*ArrayLiteral) End ¶
func (a *ArrayLiteral) End() token.Pos
func (*ArrayLiteral) Pos ¶
func (a *ArrayLiteral) Pos() token.Pos
func (*ArrayLiteral) SQL ¶
func (a *ArrayLiteral) SQL() string
type ArraySchemaType ¶
type ArraySchemaType struct { Array token.Pos // position of "ARRAY" keyword Gt token.Pos // position of ">" Item SchemaType // ScalarSchemaType or SizedSchemaType }
ArraySchemaType is array type node in schema.
ARRAY<{{.Item | sql}}>
func (*ArraySchemaType) End ¶
func (a *ArraySchemaType) End() token.Pos
func (*ArraySchemaType) Pos ¶
func (a *ArraySchemaType) Pos() token.Pos
func (*ArraySchemaType) SQL ¶
func (a *ArraySchemaType) SQL() string
type ArraySubQuery ¶
type ArraySubQuery struct { Array token.Pos // position of "ARRAY" keyword Rparen token.Pos // position of ")" Query QueryExpr }
ArraySubQuery is subquery in ARRAY call.
ARRAY({{.Query | sql}})
func (*ArraySubQuery) End ¶
func (a *ArraySubQuery) End() token.Pos
func (*ArraySubQuery) Pos ¶
func (a *ArraySubQuery) Pos() token.Pos
func (*ArraySubQuery) SQL ¶
func (a *ArraySubQuery) SQL() string
type ArrayType ¶
type ArrayType struct { Array token.Pos // position of "ARRAY" keyword Gt token.Pos // position of ">" Item Type }
ArrayType is array type node.
ARRAY<{{.Item | sql}}>
type AsAlias ¶
AsAlias is AS clause node for general purpose.
It is used in Alias node and some JoinExpr nodes.
NOTE: Sometime keyword AS can be omited.
In this case, it.token.Pos() == it.Alias.token.Pos(), so we can detect this. AS {{.Alias | sql}}
type AtTimeZone ¶
AtTimeZone is AT TIME ZONE clause in EXTRACT call.
AT TIME ZONE {{.Expr | sql}}
func (*AtTimeZone) End ¶
func (a *AtTimeZone) End() token.Pos
func (*AtTimeZone) Pos ¶
func (a *AtTimeZone) Pos() token.Pos
func (*AtTimeZone) SQL ¶
func (a *AtTimeZone) SQL() string
type BetweenExpr ¶
BetweenExpr is BETWEEN expression node.
{{.Left | sql}} {{if .Not}}NOT{{end}} BETWEEN {{.RightStart | sql}} AND {{.RightEnd | sql}}
func (*BetweenExpr) End ¶
func (b *BetweenExpr) End() token.Pos
func (*BetweenExpr) Pos ¶
func (b *BetweenExpr) Pos() token.Pos
func (*BetweenExpr) SQL ¶
func (b *BetweenExpr) SQL() string
type BinaryExpr ¶
BinaryExpr is binary operator expression node.
{{.Left | sql}} {{.Op}} {{.Right | sql}}
func (*BinaryExpr) End ¶
func (b *BinaryExpr) End() token.Pos
func (*BinaryExpr) Pos ¶
func (b *BinaryExpr) Pos() token.Pos
func (*BinaryExpr) SQL ¶
func (b *BinaryExpr) SQL() string
type BinaryOp ¶
type BinaryOp string
const ( OpOr BinaryOp = "OR" OpAnd BinaryOp = "AND" OpEqual BinaryOp = "=" OpNotEqual BinaryOp = "!=" OpLess BinaryOp = "<" OpGreater BinaryOp = ">" OpLessEqual BinaryOp = "<=" OpGreaterEqual BinaryOp = ">=" OpLike BinaryOp = "LIKE" OpNotLike BinaryOp = "NOT LIKE" OpBitOr BinaryOp = "|" OpBitXor BinaryOp = "^" OpBitAnd BinaryOp = "&" OpBitLeftShift BinaryOp = "<<" OpBitRightShift BinaryOp = ">>" OpAdd BinaryOp = "+" OpSub BinaryOp = "-" OpMul BinaryOp = "*" OpDiv BinaryOp = "/" OpConcat BinaryOp = "||" )
type BoolLiteral ¶
BoolLiteral is boolean literal node.
{{if .Value}}TRUE{{else}}FALSE{{end}}
func (*BoolLiteral) End ¶
func (b *BoolLiteral) End() token.Pos
func (*BoolLiteral) Pos ¶
func (b *BoolLiteral) Pos() token.Pos
func (*BoolLiteral) SQL ¶
func (b *BoolLiteral) SQL() string
type BytesLiteral ¶
BytesLiteral is bytes literal node.
B{{.Value | sqlBytesQuote}}
func (*BytesLiteral) End ¶
func (b *BytesLiteral) End() token.Pos
func (*BytesLiteral) Pos ¶
func (b *BytesLiteral) Pos() token.Pos
func (*BytesLiteral) SQL ¶
func (b *BytesLiteral) SQL() string
type CallExpr ¶
CallExpr is function call expression node.
{{.Func | sql}}({{if .Distinct}}DISTINCT{{end}} {{.Args | sql}})
type CaseExpr ¶
type CaseExpr struct {
Case, EndPos token.Pos // position of "CASE" and "END" keywords
Expr Expr // optional
Whens []*CaseWhen // len(Whens) > 0
Else *CaseElse // optional
}
CaseExpr is CASE expression node.
CASE {{.Expr | sqlOpt}} {{.Whens | sqlJoin "\n"}} {{.Else | sqlOpt}} END
type CaseWhen ¶
CaseWhen is WHEN clause in CASE expression.
WHEN {{.Cond | sql}} THEN {{.Then | sql}}
type CastExpr ¶
type CastExpr struct { Cast token.Pos // position of "CAST" keyword Rparen token.Pos // position of ")" Expr Expr Type Type }
CastExpr is CAST call expression node.
CAST({{.Expr | sql}} AS {{.Type | sql}})
type CastIntValue ¶
type CastIntValue struct { Cast token.Pos // position of "CAST" keyword Rparen token.Pos // position of ")" Expr IntValue // IntLit or Param }
CastIntValue is cast call in integer value context.
CAST({{.Expr | sql}} AS INT64)
func (*CastIntValue) End ¶
func (c *CastIntValue) End() token.Pos
func (*CastIntValue) Pos ¶
func (c *CastIntValue) Pos() token.Pos
func (*CastIntValue) SQL ¶
func (c *CastIntValue) SQL() string
type CastNumValue ¶
type CastNumValue struct { Cast token.Pos // position of "CAST" keyword Rparen token.Pos // position of ")" Expr NumValue // IntLit, FloatLit or Param Type ScalarTypeName // Int64Type or Float64Type }
CasrNumValue is cast call in number value context.
CAST({{.Expr | sql}} AS {{.Type}})
func (*CastNumValue) End ¶
func (c *CastNumValue) End() token.Pos
func (*CastNumValue) Pos ¶
func (c *CastNumValue) Pos() token.Pos
func (*CastNumValue) SQL ¶
func (c *CastNumValue) SQL() string
type ChangeStreamAlteration ¶
type ChangeStreamAlteration interface { Node // contains filtered or unexported methods }
ChangeStreamAlteration represents ALTER CHANGE STREAM action.
type ChangeStreamDropForAll ¶
type ChangeStreamDropForAll struct { Drop token.Pos // position of "DROP" keyword All token.Pos // position of "ALL" keyword }
ChangeStreamDropForAll is DROP FOR ALL node in ALTER CHANGE STREAM
DROP FOR ALL
func (*ChangeStreamDropForAll) End ¶
func (a *ChangeStreamDropForAll) End() token.Pos
func (*ChangeStreamDropForAll) Pos ¶
func (a *ChangeStreamDropForAll) Pos() token.Pos
func (ChangeStreamDropForAll) SQL ¶
func (a ChangeStreamDropForAll) SQL() string
type ChangeStreamFor ¶
type ChangeStreamFor interface { Node // contains filtered or unexported methods }
ChangeStreamFor represents FOR clause in CREATE/ALTER CHANGE STREAM statement.
type ChangeStreamForAll ¶
type ChangeStreamForAll struct { For token.Pos // position of "FOR" keyword All token.Pos // position of "ALL" keyword }
ChangeStreamForAll is FOR ALL node in CREATE CHANGE STREAM
FOR ALL
func (*ChangeStreamForAll) End ¶
func (c *ChangeStreamForAll) End() token.Pos
func (*ChangeStreamForAll) Pos ¶
func (c *ChangeStreamForAll) Pos() token.Pos
func (*ChangeStreamForAll) SQL ¶
func (c *ChangeStreamForAll) SQL() string
type ChangeStreamForTable ¶
type ChangeStreamForTable struct { Rparen token.Pos // position of ")" TableName *Ident Columns []*Ident }
ChangeStreamForTable table node in CREATE CHANGE STREAM SET FOR
{{.TableName | sql}}{{if .Columns}}({{.Columns | sqlJoin ","}}){{end}}
func (*ChangeStreamForTable) End ¶
func (c *ChangeStreamForTable) End() token.Pos
func (*ChangeStreamForTable) SQL ¶
func (c *ChangeStreamForTable) SQL() string
type ChangeStreamForTables ¶
type ChangeStreamForTables struct { For token.Pos // position of "FOR" keyword Tables []*ChangeStreamForTable }
ChangeStreamForTables is FOR tables node in CREATE CHANGE STREAM
FOR {{.Tables | sqlJoin ","}}
func (*ChangeStreamForTables) End ¶
func (c *ChangeStreamForTables) End() token.Pos
func (*ChangeStreamForTables) Pos ¶
func (c *ChangeStreamForTables) Pos() token.Pos
func (*ChangeStreamForTables) SQL ¶
func (c *ChangeStreamForTables) SQL() string
type ChangeStreamOptions ¶
type ChangeStreamOptions struct { Options token.Pos // position of "OPTIONS" keyword Rparen token.Pos // position of ")" Records []*ChangeStreamOptionsRecord // len(Records) > 0 }
ChangeStreamOptions is OPTIONS clause node in CREATE CHANGE STREAM.
OPTIONS ({{.Records | sqlJoin ","}})
func (*ChangeStreamOptions) End ¶
func (c *ChangeStreamOptions) End() token.Pos
func (*ChangeStreamOptions) Pos ¶
func (c *ChangeStreamOptions) Pos() token.Pos
func (*ChangeStreamOptions) SQL ¶
func (c *ChangeStreamOptions) SQL() string
type ChangeStreamOptionsRecord ¶
ChangeStreamOptionsRecord is OPTIONS record node.
{{.Key | sql}}={{.Expr | sql}}
type ChangeStreamSetFor ¶
type ChangeStreamSetFor struct { Set token.Pos // position of "SET" keyword For ChangeStreamFor }
ChangeStreamSetFor is SET FOR tables node in ALTER CHANGE STREAM
SET FOR {{.For | sql}}
func (*ChangeStreamSetFor) End ¶
func (a *ChangeStreamSetFor) End() token.Pos
func (*ChangeStreamSetFor) Pos ¶
func (a *ChangeStreamSetFor) Pos() token.Pos
func (ChangeStreamSetFor) SQL ¶
func (a ChangeStreamSetFor) SQL() string
type ChangeStreamSetOptions ¶
type ChangeStreamSetOptions struct { Set token.Pos // position of "SET" keyword Options *ChangeStreamOptions }
ChangeStreamSetOptions is SET OPTIONS node in ALTER CHANGE STREAM
SET {{.Options | sql}}
func (*ChangeStreamSetOptions) End ¶
func (a *ChangeStreamSetOptions) End() token.Pos
func (*ChangeStreamSetOptions) Pos ¶
func (a *ChangeStreamSetOptions) Pos() token.Pos
func (ChangeStreamSetOptions) SQL ¶
func (a ChangeStreamSetOptions) SQL() string
type Check ¶
type Check struct { Check token.Pos // position of "CHECK" keyword Rparen token.Pos // position of ")" after Expr Expr Expr }
Check is check constraint in CREATE TABLE and ALTER TABLE.
Check ({{.Expr}})
type Cluster ¶
type Cluster struct { Comma token.Pos // position of "," OnDeleteEnd token.Pos // end position of ON DELETE clause TableName *Ident OnDelete OnDeleteAction // optional }
Cluster is INTERLEAVE IN PARENT clause in CREATE TABLE.
, INTERLEAVE IN PARENT {{.TableName | sql}} {{.OnDelete}}
type Collate ¶
type Collate struct { Collate token.Pos // position of "COLLATE" keyword Value StringValue }
Collate is COLLATE clause node in ORDER BY item.
COLLATE {{.Value | sql}}
type ColumnDef ¶
type ColumnDef struct { Null token.Pos // position of "NULL" Name *Ident Type SchemaType NotNull bool DefaultExpr *ColumnDefaultExpr // optional GeneratedExpr *GeneratedColumnExpr // optional Options *ColumnDefOptions // optional }
ColumnDef is column definition in CREATE TABLE.
{{.Name | sql}} {{.Type | sql}} {{if .NotNull}}NOT NULL{{end}} {{.DefaultExpr | sqlOpt}} {{.GeneratedExpr | sqlOpt}} {{.Options | sqlOpt}}
type ColumnDefOptions ¶
type ColumnDefOptions struct { Options token.Pos // position of "OPTIONS" keyword Rparen token.Pos // position of ")" AllowCommitTimestamp bool }
ColumnDefOption is options for column definition.
OPTIONS(allow_commit_timestamp = {{if .AllowCommitTimestamp}}true{{else}null{{end}}})
func (*ColumnDefOptions) End ¶
func (c *ColumnDefOptions) End() token.Pos
func (*ColumnDefOptions) Pos ¶
func (c *ColumnDefOptions) Pos() token.Pos
func (*ColumnDefOptions) SQL ¶
func (c *ColumnDefOptions) SQL() string
type ColumnDefaultExpr ¶
type ColumnDefaultExpr struct { Default token.Pos // position of "DEFAULT" keyword Rparen token.Pos // position of ")" Expr Expr }
ColumnDefaultExpr is a default value expression for the column.
DEFAULT ({{.Expr | sql}})
func (*ColumnDefaultExpr) End ¶
func (g *ColumnDefaultExpr) End() token.Pos
func (*ColumnDefaultExpr) Pos ¶
func (g *ColumnDefaultExpr) Pos() token.Pos
func (*ColumnDefaultExpr) SQL ¶
func (c *ColumnDefaultExpr) SQL() string
type CompoundQuery ¶
type CompoundQuery struct { Op SetOp Distinct bool Queries []QueryExpr // len(List) >= 2 OrderBy *OrderBy // optional Limit *Limit // optional }
CompoundQuery is query statement node compounded by set operators.
{{.Queries | sqlJoin (printf "%s %s" .Op or(and(.Distinct, "DISTINCT"), "ALL"))}} {{.OrderBy | sqlOpt}} {{.Limit | sqlOpt}}
func (*CompoundQuery) End ¶
func (c *CompoundQuery) End() token.Pos
func (*CompoundQuery) Pos ¶
func (c *CompoundQuery) Pos() token.Pos
func (*CompoundQuery) SQL ¶
func (c *CompoundQuery) SQL() string
type Constraint ¶
type Constraint interface { Node // contains filtered or unexported methods }
Constraint represents table constraint of CONSTARINT clause.
type CountStarExpr ¶
type CountStarExpr struct { Count token.Pos // position of "COUNT" Rparen token.Pos // position of ")" }
CountStarExpr is node just for COUNT(*).
COUNT(*)
func (*CountStarExpr) End ¶
func (c *CountStarExpr) End() token.Pos
func (*CountStarExpr) Pos ¶
func (c *CountStarExpr) Pos() token.Pos
func (*CountStarExpr) SQL ¶
func (*CountStarExpr) SQL() string
type CreateChangeStream ¶
type CreateChangeStream struct { Create token.Pos // position of "CREATE" keyword Name *Ident For ChangeStreamFor // optional Options *ChangeStreamOptions // optional }
CreateChangeStream is CREATE CHANGE STREAM statement node.
CREATE CHANGE STREAM {{.Name | sql}} {{.For | sqlOpt}} {{.Options | sqlOpt}}
func (*CreateChangeStream) End ¶
func (c *CreateChangeStream) End() token.Pos
func (*CreateChangeStream) Pos ¶
func (c *CreateChangeStream) Pos() token.Pos
func (*CreateChangeStream) SQL ¶
func (c *CreateChangeStream) SQL() string
type CreateDatabase ¶
CreateDatabase is CREATE DATABASE statement node.
CREATE DATABASE {{.Name | sql}}
func (*CreateDatabase) End ¶
func (c *CreateDatabase) End() token.Pos
func (*CreateDatabase) Pos ¶
func (c *CreateDatabase) Pos() token.Pos
func (*CreateDatabase) SQL ¶
func (c *CreateDatabase) SQL() string
type CreateIndex ¶
type CreateIndex struct { Create token.Pos // position of "CREATE" keyword Rparen token.Pos // position of ")" Unique bool NullFiltered bool IfNotExists bool Name *Ident TableName *Ident Keys []*IndexKey Storing *Storing // optional InterleaveIn *InterleaveIn // optional }
CreateIndex is CREATE INDEX statement node.
CREATE {{if .Unique}}UNIQUE{{end}} {{if .NullFiltered}}NULL_FILTERED{{end}} INDEX {{if .IfExists}}IF NOT EXISTS{{end}} {{.Name | sql}} ON {{.TableName | sql}} ( {{.Keys | sqlJoin ","}} ) {{.Storing | sqlOpt}} {{.InterleaveIn | sqlOpt}}
func (*CreateIndex) End ¶
func (c *CreateIndex) End() token.Pos
func (*CreateIndex) Pos ¶
func (c *CreateIndex) Pos() token.Pos
func (*CreateIndex) SQL ¶
func (c *CreateIndex) SQL() string
type CreateRole ¶
CreateRole is CREATE ROLE statement node.
CREATE ROLE {{.Name | sql}}
func (*CreateRole) End ¶
func (c *CreateRole) End() token.Pos
func (*CreateRole) Pos ¶
func (c *CreateRole) Pos() token.Pos
func (*CreateRole) SQL ¶
func (c *CreateRole) SQL() string
type CreateRowDeletionPolicy ¶
type CreateRowDeletionPolicy struct { Comma token.Pos // position of "," RowDeletionPolicy *RowDeletionPolicy }
CreateRowDeletionPolicy is ROW DELETION POLICY clause in CREATE TABLE.
, {{.RowDeletionPolicy}}
func (*CreateRowDeletionPolicy) End ¶
func (c *CreateRowDeletionPolicy) End() token.Pos
func (*CreateRowDeletionPolicy) Pos ¶
func (c *CreateRowDeletionPolicy) Pos() token.Pos
func (*CreateRowDeletionPolicy) SQL ¶
func (c *CreateRowDeletionPolicy) SQL() string
type CreateSequence ¶
type CreateSequence struct { Create token.Pos // position of "CREATE" keyword Rparen token.Pos // position of ")" of OPTIONS clause Name *Ident IfNotExists bool Options []*SequenceOption // len(Options) > 0 }
CreateSequence is CREATE SEQUENCE statement node.
CREATE SEQUENCE {{if .IfNotExists}}IF NOT EXISTS{{end}} {{.Name | sql}} }} OPTIONS ({{.Options | sqlJoin ","}})
func (*CreateSequence) End ¶
func (c *CreateSequence) End() token.Pos
func (*CreateSequence) Pos ¶
func (c *CreateSequence) Pos() token.Pos
func (*CreateSequence) SQL ¶
func (c *CreateSequence) SQL() string
type CreateTable ¶
type CreateTable struct { Create token.Pos // position of "CREATE" keyword Rparen token.Pos // position of ")" of PRIMARY KEY clause IfNotExists bool Name *Ident Columns []*ColumnDef TableConstraints []*TableConstraint PrimaryKeys []*IndexKey Cluster *Cluster // optional RowDeletionPolicy *CreateRowDeletionPolicy // optional }
CreateTable is CREATE TABLE statement node.
CREATE TABLE {{if .IfNotExists}}IF NOT EXISTS{{end}} {{.Name | sql}} ( {{.Columns | sqlJoin ","}} {{if and .Columns .TableConstrains}},{{end}}{{.TableConstraints | sqlJoin ","}} ) PRIMARY KEY ({{.PrimaryKeys | sqlJoin ","}}) {{.Cluster | sqlOpt}} {{.CreateRowDeletionPolicy | sqlOpt}}
Spanner SQL allows to mix `Columns` and `TableConstraints`, however they are separated in AST definition for historical reasons. If you want to get the original order of them, please sort them by their `Pos()`.
func (*CreateTable) End ¶
func (c *CreateTable) End() token.Pos
func (*CreateTable) Pos ¶
func (c *CreateTable) Pos() token.Pos
func (*CreateTable) SQL ¶
func (c *CreateTable) SQL() string
type CreateView ¶
type CreateView struct { Create token.Pos Name *Ident OrReplace bool SecurityType SecurityType Query QueryExpr }
CreateView is CREATE VIEW statement node.
CREATE {{if .OrReplace}}OR REPLACE{{end}} VIEW {{.Name | sql}} SQL SECURITY {{.SecurityType}} AS {{.Query | sql}}
func (*CreateView) End ¶
func (c *CreateView) End() token.Pos
func (*CreateView) Pos ¶
func (c *CreateView) Pos() token.Pos
func (*CreateView) SQL ¶
func (c *CreateView) SQL() string
type DDL ¶
type DDL interface { Statement // contains filtered or unexported methods }
DDL represents data definition language in SQL.
https://cloud.google.com/spanner/docs/data-definition-language
type DML ¶
type DML interface { Statement // contains filtered or unexported methods }
DML represents data manipulation language in SQL.
https://cloud.google.com/spanner/docs/data-definition-language
type DateLiteral ¶
type DateLiteral struct { Date token.Pos // position of "DATE" Value *StringLiteral }
DateLiteral is date literal node.
DATE {{.Value | sql}}
func (*DateLiteral) End ¶
func (d *DateLiteral) End() token.Pos
func (*DateLiteral) Pos ¶
func (d *DateLiteral) Pos() token.Pos
func (*DateLiteral) SQL ¶
func (d *DateLiteral) SQL() string
type DefaultExpr ¶
DefaultExpr is DEFAULT or Expr.
{{if .Default}}DEFAULT{{else}}{{.Expr | sql}}{{end}}
func (*DefaultExpr) End ¶
func (d *DefaultExpr) End() token.Pos
func (*DefaultExpr) Pos ¶
func (d *DefaultExpr) Pos() token.Pos
func (*DefaultExpr) SQL ¶
func (d *DefaultExpr) SQL() string
type Delete ¶
type Delete struct { Delete token.Pos // position of "DELETE" keyword TableName *Ident As *AsAlias // optional Where *Where }
Delete is DELETE statement.
DELETE FROM {{.TableName | sql}} {{.As | sqlOpt}} {{.Where | sql}}
type DeletePrivilege ¶
DeletePrivilege is DELETE ON TABLE privilege node in GRANT and REVOKE.
DELETE
func (*DeletePrivilege) End ¶
func (d *DeletePrivilege) End() token.Pos
func (*DeletePrivilege) Pos ¶
func (d *DeletePrivilege) Pos() token.Pos
func (*DeletePrivilege) SQL ¶
func (d *DeletePrivilege) SQL() string
type DropChangeStream ¶
DropChangeStream is DROP CHANGE STREAM statement node.
DROP CHANGE STREAM {{.Name | sql}}
func (*DropChangeStream) End ¶
func (d *DropChangeStream) End() token.Pos
func (*DropChangeStream) Pos ¶
func (d *DropChangeStream) Pos() token.Pos
func (*DropChangeStream) SQL ¶
func (d *DropChangeStream) SQL() string
type DropColumn ¶
DropColumn is DROP COLUMN clause in ALTER TABLE.
DROP COLUMN {{.Name | sql}}
func (*DropColumn) End ¶
func (d *DropColumn) End() token.Pos
func (*DropColumn) Pos ¶
func (d *DropColumn) Pos() token.Pos
func (*DropColumn) SQL ¶
func (d *DropColumn) SQL() string
type DropConstraint ¶
DropConstraint is DROP CONSTRAINT clause in ALTER TABLE.
DROP CONSTRAINT {{.Name | sql}}
func (*DropConstraint) End ¶
func (d *DropConstraint) End() token.Pos
func (*DropConstraint) Pos ¶
func (d *DropConstraint) Pos() token.Pos
func (*DropConstraint) SQL ¶
func (d *DropConstraint) SQL() string
type DropIndex ¶
DropIndex is DROP INDEX statement node.
DROP INDEX {{if .IfExists}}IF EXISTS{{end}} {{.Name | sql}}
type DropRowDeletionPolicy ¶
type DropRowDeletionPolicy struct { Drop token.Pos // position of "DROP" keyword Policy token.Pos // position of "POLICY" keyword }
DropRowDeletionPolicy is DROP ROW DELETION POLICY clause in ALTER TABLE.
DROP ROW DELETION POLICY
func (*DropRowDeletionPolicy) End ¶
func (d *DropRowDeletionPolicy) End() token.Pos
func (*DropRowDeletionPolicy) Pos ¶
func (d *DropRowDeletionPolicy) Pos() token.Pos
func (*DropRowDeletionPolicy) SQL ¶
func (d *DropRowDeletionPolicy) SQL() string
type DropStoredColumn ¶
DropStoredColumn is DROP STORED COLUMN clause in ALTER INDEX.
DROP STORED COLUMN {{.Name | sql}}
func (*DropStoredColumn) End ¶
func (a *DropStoredColumn) End() token.Pos
func (*DropStoredColumn) Pos ¶
func (a *DropStoredColumn) Pos() token.Pos
func (*DropStoredColumn) SQL ¶
func (a *DropStoredColumn) SQL() string
type DropTable ¶
DropTable is DROP TABLE statement node.
DROP TABLE {{if .IfExists}}IF NOT EXISTS{{end}} {{.Name | sql}}
type ExecutePrivilegeOnTableFunction ¶
ExecutePrivilegeOnTableFunction is EXECUTE ON TABLE FUNCTION privilege node in GRANT and REVOKE.
EXECUTE ON TABLE FUNCTION {{.Names | sqlJoin ","}}
func (*ExecutePrivilegeOnTableFunction) End ¶
func (e *ExecutePrivilegeOnTableFunction) End() token.Pos
func (*ExecutePrivilegeOnTableFunction) Pos ¶
func (e *ExecutePrivilegeOnTableFunction) Pos() token.Pos
func (*ExecutePrivilegeOnTableFunction) SQL ¶
func (e *ExecutePrivilegeOnTableFunction) SQL() string
type ExistsSubQuery ¶
type ExistsSubQuery struct { Exists token.Pos // position of "EXISTS" keyword Rparen token.Pos // position of ")" Hint *Hint Query QueryExpr }
ExistsSubQuery is subquery in EXISTS call.
EXISTS {{.Hint | sqlOpt}} ({{.Query | sql}})
func (*ExistsSubQuery) End ¶
func (e *ExistsSubQuery) End() token.Pos
func (*ExistsSubQuery) Pos ¶
func (e *ExistsSubQuery) Pos() token.Pos
func (*ExistsSubQuery) SQL ¶
func (e *ExistsSubQuery) SQL() string
type Expr ¶
type Expr interface { Node // contains filtered or unexported methods }
Expr repersents an expression in SQL.
type ExprArg ¶
type ExprArg struct {
Expr Expr
}
ExprArg is argument of the generic function call.
{{.Expr | sql}}
type ExprSelectItem ¶
type ExprSelectItem struct {
Expr Expr
}
ExprSelectItem is Expr wrapper for SelectItem.
{{.Expr | sql}}
func (*ExprSelectItem) End ¶
func (e *ExprSelectItem) End() token.Pos
func (*ExprSelectItem) Pos ¶
func (e *ExprSelectItem) Pos() token.Pos
func (*ExprSelectItem) SQL ¶
func (e *ExprSelectItem) SQL() string
type ExtractExpr ¶
type ExtractExpr struct { Extract token.Pos // position of "EXTRACT" keyword Rparen token.Pos // position of ")" Part *Ident Expr Expr AtTimeZone *AtTimeZone // optional }
ExtractExpr is EXTRACT call expression node.
EXTRACT({{.Part | sql}} FROM {{.Expr | sql}} {{.AtTimeZone | sqlOpt}})
func (*ExtractExpr) End ¶
func (e *ExtractExpr) End() token.Pos
func (*ExtractExpr) Pos ¶
func (e *ExtractExpr) Pos() token.Pos
func (*ExtractExpr) SQL ¶
func (e *ExtractExpr) SQL() string
type FloatLiteral ¶
FloatLiteral is floating point number literal node.
{{.Value}}
func (*FloatLiteral) End ¶
func (f *FloatLiteral) End() token.Pos
func (*FloatLiteral) Pos ¶
func (f *FloatLiteral) Pos() token.Pos
func (*FloatLiteral) SQL ¶
func (f *FloatLiteral) SQL() string
type ForeignKey ¶
type ForeignKey struct { Foreign token.Pos // position of "FOREIGN" keyword Rparen token.Pos // position of ")" after reference columns OnDeleteEnd token.Pos // end position of ON DELETE clause Columns []*Ident ReferenceTable *Ident ReferenceColumns []*Ident // len(ReferenceColumns) > 0 OnDelete OnDeleteAction // optional }
ForeignKey is foreign key specifier in CREATE TABLE and ALTER TABLE.
FOREIGN KEY ({{.ColumnNames | sqlJoin ","}}) REFERENCES {{.ReferenceTable}} ({{.ReferenceColumns | sqlJoin ","}}) {{.OnDelete}}
func (*ForeignKey) End ¶
func (f *ForeignKey) End() token.Pos
func (*ForeignKey) Pos ¶
func (f *ForeignKey) Pos() token.Pos
func (*ForeignKey) SQL ¶
func (f *ForeignKey) SQL() string
type GeneratedColumnExpr ¶
type GeneratedColumnExpr struct { As token.Pos // position of "AS" keyword Stored token.Pos // position of "STORED" keyword Expr Expr }
GeneratedColumnExpr is generated column expression.
AS ({{.Expr | sql}}) STORED
func (*GeneratedColumnExpr) End ¶
func (g *GeneratedColumnExpr) End() token.Pos
func (*GeneratedColumnExpr) Pos ¶
func (g *GeneratedColumnExpr) Pos() token.Pos
func (*GeneratedColumnExpr) SQL ¶
func (g *GeneratedColumnExpr) SQL() string
type Grant ¶
type Grant struct { Grant token.Pos // position of "GRANT" keyword Privilege Privilege Roles []*Ident }
Grant is GRANT statement node.
GRANT {{.Privilege | sql}} TO ROLE {{.Roles | sqlJoin ","}}
type GroupBy ¶
type GroupBy struct { Group token.Pos // position of "GROUP" keyword Exprs []Expr // len(Exprs) > 0 }
GroupBy is GROUP BY clause node.
GROUP BY {{.Exprs | sqlJoin ","}}
type Hint ¶
type Hint struct { Atmark token.Pos // position of "@" Rbrace token.Pos // position of "}" Records []*HintRecord // len(Records) > 0 }
Hint is hint node.
@{{"{"}}{{.Records | sqlJoin ","}}{{"}"}}
type HintRecord ¶
HintRecord is hint record node.
{{.Key | sql}}={{.Value | sql}}
func (*HintRecord) End ¶
func (h *HintRecord) End() token.Pos
func (*HintRecord) Pos ¶
func (h *HintRecord) Pos() token.Pos
func (*HintRecord) SQL ¶
func (h *HintRecord) SQL() string
type InCondition ¶
type InCondition interface { Node // contains filtered or unexported methods }
InCondition is right-side value of IN operator.
type InExpr ¶
type InExpr struct { Not bool Left Expr Right InCondition }
InExpr is IN expression node.
{{.Left | sql}} {{if .Not}}NOT{{end}} IN {{.Right | sql}}
type IndexAlteration ¶
type IndexAlteration interface { Node // contains filtered or unexported methods }
IndexAlteration represents ALTER INDEX action.
type IndexExpr ¶
IndexExpr is array item access expression node.
{{.Expr | sql}}[{{if .Ordinal}}ORDINAL{{else}}OFFSET{{end}}({{.Index | sql}})]
type IndexKey ¶
IndexKey is index key specifier in CREATE TABLE and CREATE INDEX.
{{.Name | sql}} {{.Dir}}
type Insert ¶
type Insert struct { Insert token.Pos // position of "INSERT" keyword InsertOrType InsertOrType TableName *Ident Columns []*Ident Input InsertInput }
Insert is INSERT statement node.
INSERT {{if .InsertOrType}}OR .InsertOrType{{end}}INTO {{.TableName | sql}} ({{.Columns | sqlJoin ","}}) {{.Input | sql}}
type InsertInput ¶
type InsertInput interface { Node // contains filtered or unexported methods }
InsertInput represents input values of INSERT statement.
type InsertOrType ¶
type InsertOrType string
const ( InsertOrTypeUpdate InsertOrType = "UPDATE" InsertOrTypeIgnore InsertOrType = "IGNORE" )
type InsertPrivilege ¶
type InsertPrivilege struct { Insert token.Pos // position of "INSERT" keyword Rparen token.Pos // position of ")" when len(Columns) > 0 Columns []*Ident }
InsertPrivilege is INSERT ON TABLE privilege node in GRANT and REVOKE.
INSERT{{if .Columns}}({{.Columns | sqlJoin ","}}){{end}}
func (*InsertPrivilege) End ¶
func (i *InsertPrivilege) End() token.Pos
func (*InsertPrivilege) Pos ¶
func (i *InsertPrivilege) Pos() token.Pos
func (*InsertPrivilege) SQL ¶
func (i *InsertPrivilege) SQL() string
type IntLiteral ¶
type IntLiteral struct {
ValuePos, ValueEnd token.Pos // position of this value
Base int // 10 or 16
Value string
}
IntLiteral is integer literal node.
{{.Value}}
func (*IntLiteral) End ¶
func (i *IntLiteral) End() token.Pos
func (*IntLiteral) Pos ¶
func (i *IntLiteral) Pos() token.Pos
func (*IntLiteral) SQL ¶
func (i *IntLiteral) SQL() string
type IntValue ¶
type IntValue interface { Node // contains filtered or unexported methods }
IntValue represents integer values in SQL.
type InterleaveIn ¶
InterleaveIn is INTERLEAVE IN clause in CREATE INDEX.
, INTERLEAVE IN {{.TableName | sql}}
func (*InterleaveIn) End ¶
func (i *InterleaveIn) End() token.Pos
func (*InterleaveIn) Pos ¶
func (i *InterleaveIn) Pos() token.Pos
func (*InterleaveIn) SQL ¶
func (i *InterleaveIn) SQL() string
type IntervalArg ¶
type IntervalArg struct { Interval token.Pos // position of "INTERVAL" keyword Expr Expr Unit *Ident // optional }
IntervalArg is argument of date function call.
INTERVAL {{.Expr | sql}} {{.Unit | sqlOpt}}
func (*IntervalArg) End ¶
func (i *IntervalArg) End() token.Pos
func (*IntervalArg) Pos ¶
func (i *IntervalArg) Pos() token.Pos
func (*IntervalArg) SQL ¶
func (i *IntervalArg) SQL() string
type IsBoolExpr ¶
IsBoolExpr is IS TRUE/FALSE expression node.
{{.Left | sql}} IS {{if .Not}}NOT{{end}} {{if .Right}}TRUE{{else}}FALSE{{end}}
func (*IsBoolExpr) End ¶
func (i *IsBoolExpr) End() token.Pos
func (*IsBoolExpr) Pos ¶
func (i *IsBoolExpr) Pos() token.Pos
func (*IsBoolExpr) SQL ¶
func (i *IsBoolExpr) SQL() string
type IsNullExpr ¶
IsNullExpr is IS NULL expression node.
{{.Left | sql}} IS {{if .Not}}NOT{{end}} NULL
func (*IsNullExpr) End ¶
func (i *IsNullExpr) End() token.Pos
func (*IsNullExpr) Pos ¶
func (i *IsNullExpr) Pos() token.Pos
func (*IsNullExpr) SQL ¶
func (i *IsNullExpr) SQL() string
type Join ¶
type Join struct { Op JoinOp Method JoinMethod Hint *Hint // optional Left, Right TableExpr Cond JoinCondition // nil when Op is CrossJoin, otherwise it must be set. }
Join is JOIN expression.
{{.Left | sql}} {{.Op}} {{.Method}} {{.Hint | sqlOpt}} {{.Right | sql}} {{.Cond | sqlOpt}}
type JoinCondition ¶
type JoinCondition interface { Node // contains filtered or unexported methods }
JoinCondition represents condition part of JOIN expression.
type JoinHintKey ¶
type JoinHintKey string
const ( ForceJoinOrderJoinHint JoinHintKey = "FORCE_JOIN_ORDER" JoinTypeJoinHint JoinHintKey = "JOIN_TYPE" )
type JoinMethod ¶
type JoinMethod string
const ( HashJoinMethod JoinMethod = "HASH" ApplyJoinMethod JoinMethod = "APPLY" LoopJoinMethod JoinMethod = "LOOP" // Undocumented, but the Spanner accept this value at least. )
type Limit ¶
type Limit struct { Limit token.Pos // position of "LIMIT" keyword Count IntValue Offset *Offset // optional }
Limit is LIMIT clause node.
LIMIT {{.Count | sql}} {{.Offset | sqlOpt}}
type Node ¶
type Node interface { Pos() token.Pos End() token.Pos // Convert AST node into SQL source string (a.k.a. Unparse). SQL() string }
Node is base interface of Spanner SQL AST nodes.
type NullLiteral ¶
NullLiteral is just NULL literal.
NULL
func (*NullLiteral) End ¶
func (n *NullLiteral) End() token.Pos
func (*NullLiteral) Pos ¶
func (n *NullLiteral) Pos() token.Pos
func (*NullLiteral) SQL ¶
func (*NullLiteral) SQL() string
type NumValue ¶
type NumValue interface { Node // contains filtered or unexported methods }
NumValue represents number values in SQL.
type NumericLiteral ¶
type NumericLiteral struct { Numeric token.Pos // position of "NUMERIC" Value *StringLiteral }
NumericLiteral is numeric literal node.
NUMERIC {{.Value | sql}}
func (*NumericLiteral) End ¶
func (t *NumericLiteral) End() token.Pos
func (*NumericLiteral) Pos ¶
func (t *NumericLiteral) Pos() token.Pos
func (*NumericLiteral) SQL ¶
func (t *NumericLiteral) SQL() string
type OnDeleteAction ¶
type OnDeleteAction string
const ( OnDeleteCascade OnDeleteAction = "ON DELETE CASCADE" OnDeleteNoAction OnDeleteAction = "ON DELETE NO ACTION" )
type OrderBy ¶
type OrderBy struct { Order token.Pos // position of "ORDER" keyword Items []*OrderByItem // len(Items) > 0 }
OrderBy is ORDER BY clause node.
ORDER BY {{.Items | sqlJoin ","}}
type OrderByItem ¶
type OrderByItem struct { DirPos token.Pos // position of Dir Expr Expr Collate *Collate // optional Dir Direction // optional }
OrderByItem is expression node in ORDER BY clause list.
{{.Expr | sql}} {{.Collate | sqlOpt}} {{.Direction}}
func (*OrderByItem) End ¶
func (o *OrderByItem) End() token.Pos
func (*OrderByItem) Pos ¶
func (o *OrderByItem) Pos() token.Pos
func (*OrderByItem) SQL ¶
func (o *OrderByItem) SQL() string
type ParenTableExpr ¶
type ParenTableExpr struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Source TableExpr // SubQueryJoinExpr (without As) or Join
Sample *TableSample // optional
}
ParenTableExpr is parenthesized JOIN expression.
({{.Source | sql}}) {{.Sample | sqlOpt}}
func (*ParenTableExpr) End ¶
func (p *ParenTableExpr) End() token.Pos
func (*ParenTableExpr) Pos ¶
func (p *ParenTableExpr) Pos() token.Pos
func (*ParenTableExpr) SQL ¶
func (p *ParenTableExpr) SQL() string
type Path ¶
type Path struct {
Idents []*Ident // len(Idents) >= 2
}
Path is dot-chained identifier list.
{{.Idents | sqlJoin "."}}
type Privilege ¶
type Privilege interface { Node // contains filtered or unexported methods }
Privilege represents privileges specified by GRANT and REVOKE.
type PrivilegeOnTable ¶
type PrivilegeOnTable struct { Privileges []TablePrivilege // len(Privileges) > 0 Names []*Ident // len(Names) > 0 }
PrivilegeOnTable is ON TABLE privilege node in GRANT and REVOKE.
{{.Privileges | sqlJoin ","}} ON TABLE {{.Names | sqlJoin ","}}
func (*PrivilegeOnTable) End ¶
func (p *PrivilegeOnTable) End() token.Pos
func (*PrivilegeOnTable) Pos ¶
func (p *PrivilegeOnTable) Pos() token.Pos
func (*PrivilegeOnTable) SQL ¶
func (p *PrivilegeOnTable) SQL() string
type QueryExpr ¶
type QueryExpr interface { Node // contains filtered or unexported methods }
QueryExpr represents set operator operands.
type QueryStatement ¶
QueryStatement is query statement node.
{{if .Hint}}{{.Hint | sql}}{{end}} {{.Expr | sql}}
https://cloud.google.com/spanner/docs/query-syntax
func (*QueryStatement) End ¶
func (q *QueryStatement) End() token.Pos
func (*QueryStatement) Pos ¶
func (q *QueryStatement) Pos() token.Pos
func (*QueryStatement) SQL ¶
func (q *QueryStatement) SQL() string
type ReplaceRowDeletionPolicy ¶
type ReplaceRowDeletionPolicy struct { Replace token.Pos // position of "REPLACE" keyword RowDeletionPolicy *RowDeletionPolicy }
ReplaceRowDeletionPolicy is REPLACE ROW DELETION POLICY clause in ALTER TABLE.
REPLACE {{.RowDeletionPolicy}}
func (*ReplaceRowDeletionPolicy) End ¶
func (d *ReplaceRowDeletionPolicy) End() token.Pos
func (*ReplaceRowDeletionPolicy) Pos ¶
func (d *ReplaceRowDeletionPolicy) Pos() token.Pos
func (*ReplaceRowDeletionPolicy) SQL ¶
func (r *ReplaceRowDeletionPolicy) SQL() string
type Revoke ¶
type Revoke struct { Revoke token.Pos // position of "REVOKE" keyword Privilege Privilege // len(Privileges) > 0 Roles []*Ident // len(Roles) > 0 }
Revoke is REVOKE statement node.
REVOKE {{.Privilege | sql}} FROM ROLE {{.Roles | sqlJoin ","}}
type RolePrivilege ¶
RolePrivilege is ROLE privilege node in GRANT and REVOKE.
ROLE {{.Names | sqlJoin ","}}
func (*RolePrivilege) End ¶
func (r *RolePrivilege) End() token.Pos
func (*RolePrivilege) Pos ¶
func (r *RolePrivilege) Pos() token.Pos
func (*RolePrivilege) SQL ¶
func (r *RolePrivilege) SQL() string
type RowDeletionPolicy ¶
type RowDeletionPolicy struct { Row token.Pos // position of "ROW" Rparen token.Pos // position of ")" ColumnName *Ident NumDays *IntLiteral }
RowDeletionPolicy is ROW DELETION POLICY clause.
ROW DELETION POLICY (OLDER_THAN({{.ColymnName | sql}}, INTERVAL {{.NumDays}} DAY))
func (*RowDeletionPolicy) End ¶
func (r *RowDeletionPolicy) End() token.Pos
func (*RowDeletionPolicy) Pos ¶
func (r *RowDeletionPolicy) Pos() token.Pos
func (*RowDeletionPolicy) SQL ¶
func (r *RowDeletionPolicy) SQL() string
type ScalarSchemaType ¶
type ScalarSchemaType struct { NamePos token.Pos // position of this name Name ScalarTypeName // except for StringTypeName and BytesTypeName }
ScalarSchemaType is scalar type node in schema.
{{.Name}}
func (*ScalarSchemaType) End ¶
func (s *ScalarSchemaType) End() token.Pos
func (*ScalarSchemaType) Pos ¶
func (s *ScalarSchemaType) Pos() token.Pos
func (*ScalarSchemaType) SQL ¶
func (s *ScalarSchemaType) SQL() string
type ScalarSubQuery ¶
ScalarSubQuery is subquery in expression.
({{.Query | sql}})
func (*ScalarSubQuery) End ¶
func (s *ScalarSubQuery) End() token.Pos
func (*ScalarSubQuery) Pos ¶
func (s *ScalarSubQuery) Pos() token.Pos
func (*ScalarSubQuery) SQL ¶
func (s *ScalarSubQuery) SQL() string
type ScalarTypeName ¶
type ScalarTypeName string
const ( BoolTypeName ScalarTypeName = "BOOL" Int64TypeName ScalarTypeName = "INT64" Float64TypeName ScalarTypeName = "FLOAT64" StringTypeName ScalarTypeName = "STRING" BytesTypeName ScalarTypeName = "BYTES" DateTypeName ScalarTypeName = "DATE" TimestampTypeName ScalarTypeName = "TIMESTAMP" NumericTypeName ScalarTypeName = "NUMERIC" )
type SchemaType ¶
type SchemaType interface { Node // contains filtered or unexported methods }
SchemaType represents types for schema.
type SecurityType ¶
type SecurityType string
const ( SecurityTypeInvoker SecurityType = "INVOKER" SecurityTypeDefiner SecurityType = "DEFINER" )
type Select ¶
type Select struct { Select token.Pos // position of "select" keyword Distinct bool AsStruct bool Results []SelectItem // len(Results) > 0 From *From // optional Where *Where // optional GroupBy *GroupBy // optional Having *Having // optional OrderBy *OrderBy // optional Limit *Limit // optional }
Select is SELECT statement node.
SELECT {{if .Distinct}}DISTINCT{{end}} {{if .AsStruct}}AS STRUCT{{end}} {{.Results | sqlJoin ","}} {{.From | sqlOpt}} {{.Where | sqlOpt}} {{.GroupBy | sqlOpt}} {{.Having | sqlOpt}} {{.OrderBy | sqlOpt}} {{.Limit | sqlOpt}}
type SelectItem ¶
type SelectItem interface { Node // contains filtered or unexported methods }
SelectItem represents expression in SELECT clause result columns list.
type SelectPrivilege ¶
type SelectPrivilege struct { Select token.Pos // position of "SELECT" keyword Rparen token.Pos // position of ")" when len(Columns) > 0 Columns []*Ident }
SelectPrivilege is SELECT ON TABLE privilege node in GRANT and REVOKE.
SELECT{{if .Columns}}({{.Columns | sqlJoin ","}}){{end}}
func (*SelectPrivilege) End ¶
func (s *SelectPrivilege) End() token.Pos
func (*SelectPrivilege) Pos ¶
func (s *SelectPrivilege) Pos() token.Pos
func (*SelectPrivilege) SQL ¶
func (s *SelectPrivilege) SQL() string
type SelectPrivilegeOnView ¶
SelectPrivilegeOnView is SELECT ON VIEW privilege node in GRANT and REVOKE.
SELECT ON VIEW {{.Names | sqlJoin ","}}
func (*SelectPrivilegeOnView) End ¶
func (s *SelectPrivilegeOnView) End() token.Pos
func (*SelectPrivilegeOnView) Pos ¶
func (s *SelectPrivilegeOnView) Pos() token.Pos
func (*SelectPrivilegeOnView) SQL ¶
func (s *SelectPrivilegeOnView) SQL() string
type SelectorExpr ¶
SelectorExpr is struct field access expression node.
{{.Expr | sql}}.{{.Ident | sql}}
func (*SelectorExpr) End ¶
func (b *SelectorExpr) End() token.Pos
func (*SelectorExpr) Pos ¶
func (b *SelectorExpr) Pos() token.Pos
func (*SelectorExpr) SQL ¶
func (s *SelectorExpr) SQL() string
type SequenceArg ¶
SequenceArg is argument of sequence function call.
SEQUENCE {{.Expr | sql}}
func (*SequenceArg) End ¶
func (s *SequenceArg) End() token.Pos
func (*SequenceArg) Pos ¶
func (s *SequenceArg) Pos() token.Pos
func (*SequenceArg) SQL ¶
func (s *SequenceArg) SQL() string
type SequenceOption ¶
SequenceOption is option for CREATE SEQUENCE.
{{.Name | sql}} = {{.Value | sql}}
func (*SequenceOption) End ¶
func (o *SequenceOption) End() token.Pos
func (*SequenceOption) Pos ¶
func (o *SequenceOption) Pos() token.Pos
func (*SequenceOption) SQL ¶
func (o *SequenceOption) SQL() string
type SetOnDelete ¶
type SetOnDelete struct { Set token.Pos // position of "SET" keyword OnDeleteEnd token.Pos // end position of ON DELETE clause OnDelete OnDeleteAction }
SetOnDelete is SET ON DELETE clause in ALTER TABLE.
SET ON DELETE {{.OnDelete}}
func (*SetOnDelete) End ¶
func (s *SetOnDelete) End() token.Pos
func (*SetOnDelete) Pos ¶
func (s *SetOnDelete) Pos() token.Pos
func (*SetOnDelete) SQL ¶
func (s *SetOnDelete) SQL() string
type SimpleType ¶
type SimpleType struct { NamePos token.Pos // position of this name Name ScalarTypeName }
SimpleType is type node having no parameter like INT64, STRING.
{{.Name}}
func (*SimpleType) End ¶
func (s *SimpleType) End() token.Pos
func (*SimpleType) Pos ¶
func (s *SimpleType) Pos() token.Pos
func (*SimpleType) SQL ¶
func (s *SimpleType) SQL() string
type SizedSchemaType ¶
type SizedSchemaType struct { NamePos token.Pos // position of this name Rparen token.Pos // position of ")" Name ScalarTypeName // StringTypeName or BytesTypeName // either Max or Size must be set Max bool Size IntValue }
SizedSchemaType is sized type node in schema.
{{.Name}}({{if .Max}}MAX{{else}}{{.Size | sql}}{{end}})
func (*SizedSchemaType) End ¶
func (s *SizedSchemaType) End() token.Pos
func (*SizedSchemaType) Pos ¶
func (s *SizedSchemaType) Pos() token.Pos
func (*SizedSchemaType) SQL ¶
func (s *SizedSchemaType) SQL() string
type Statement ¶
type Statement interface { Node // contains filtered or unexported methods }
Statement represents toplevel statement node of Spanner SQL.
type Storing ¶
type Storing struct { Storing token.Pos // position of "STORING" keyword Rparen token.Pos // position of ")" Columns []*Ident }
Storing is STORING clause in CREATE INDEX.
STORING ({{.Columns | sqlJoin ","}})
type StringLiteral ¶
StringLiteral is string literal node.
{{.Value | sqlStringQuote}}
func (*StringLiteral) End ¶
func (s *StringLiteral) End() token.Pos
func (*StringLiteral) Pos ¶
func (s *StringLiteral) Pos() token.Pos
func (*StringLiteral) SQL ¶
func (s *StringLiteral) SQL() string
type StringValue ¶
type StringValue interface { Node // contains filtered or unexported methods }
StringValue represents string value in SQL.
type StructField ¶
StructField is field in struct type node.
{{if .Ident}}{{.Ident | sql}}{{end}} {{.Type | sql}}
func (*StructField) End ¶
func (f *StructField) End() token.Pos
func (*StructField) Pos ¶
func (f *StructField) Pos() token.Pos
func (*StructField) SQL ¶
func (f *StructField) SQL() string
type StructLiteral ¶
type StructLiteral struct { Struct token.Pos // position of "STRUCT" Lparen, Rparen token.Pos // position of "(" and ")" // NOTE: Distinguish nil from len(Fields) == 0 case. // nil means type is not specified, or empty slice means this struct has 0 fields. Fields []*StructField Values []Expr }
StructLiteral is struct literal node.
STRUCT{{if not (isnil .Fields)}}<{{.Fields | sqlJoin ","}}>{{end}}({{.Values | sqlJoin ","}})
func (*StructLiteral) End ¶
func (s *StructLiteral) End() token.Pos
func (*StructLiteral) Pos ¶
func (s *StructLiteral) Pos() token.Pos
func (*StructLiteral) SQL ¶
func (s *StructLiteral) SQL() string
type StructType ¶
type StructType struct { Struct token.Pos // position of "STRUCT" Gt token.Pos // position of ">" Fields []*StructField }
StructType is struct type node.
STRUCT<{{.Fields | sqlJoin ","}}>
func (*StructType) End ¶
func (s *StructType) End() token.Pos
func (*StructType) Pos ¶
func (s *StructType) Pos() token.Pos
func (*StructType) SQL ¶
func (s *StructType) SQL() string
type SubQuery ¶
type SubQuery struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Query QueryExpr
OrderBy *OrderBy // optional
Limit *Limit // optional
}
SubQuery is subquery statement node.
({{.Expr | sql}} {{.OrderBy | sqlOpt}} {{.Limit | sqlOpt}})
type SubQueryInCondition ¶
type SubQueryInCondition struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Query QueryExpr
}
SubQueryInCondition is subquery at IN condition.
({{.Query | sql}})
func (*SubQueryInCondition) End ¶
func (s *SubQueryInCondition) End() token.Pos
func (*SubQueryInCondition) Pos ¶
func (s *SubQueryInCondition) Pos() token.Pos
func (*SubQueryInCondition) SQL ¶
func (s *SubQueryInCondition) SQL() string
type SubQueryInput ¶
type SubQueryInput struct {
Query QueryExpr
}
SubQueryInput is query clause in INSERT.
{{.Query | sql}}
func (*SubQueryInput) End ¶
func (s *SubQueryInput) End() token.Pos
func (*SubQueryInput) Pos ¶
func (s *SubQueryInput) Pos() token.Pos
func (*SubQueryInput) SQL ¶
func (s *SubQueryInput) SQL() string
type SubQueryTableExpr ¶
type SubQueryTableExpr struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Query QueryExpr
As *AsAlias // optional
Sample *TableSample // optional
}
SubQueryTableExpr is subquery inside JOIN expression.
({{.Query | sql}}) {{.As | sqlOpt}} {{.Sample | sqlOpt}}
func (*SubQueryTableExpr) End ¶
func (s *SubQueryTableExpr) End() token.Pos
func (*SubQueryTableExpr) Pos ¶
func (s *SubQueryTableExpr) Pos() token.Pos
func (*SubQueryTableExpr) SQL ¶
func (s *SubQueryTableExpr) SQL() string
type TableAlteration ¶
type TableAlteration interface { Node // contains filtered or unexported methods }
TableAlteration represents ALTER TABLE action.
type TableConstraint ¶
type TableConstraint struct { ConstraintPos token.Pos // position of "CONSTRAINT" keyword when Name presents Name *Ident // optional Constraint Constraint }
TableConstraint is table constraint in CREATE TABLE and ALTER TABLE.
{{if .Name}}CONSTRAINT {{.Name}}{{end}}{{.Constraint | sql}}
func (*TableConstraint) End ¶
func (c *TableConstraint) End() token.Pos
func (*TableConstraint) Pos ¶
func (c *TableConstraint) Pos() token.Pos
func (*TableConstraint) SQL ¶
func (c *TableConstraint) SQL() string
type TableExpr ¶
type TableExpr interface { Node // contains filtered or unexported methods }
TableExpr represents JOIN operands.
type TableHintKey ¶
type TableHintKey string
const ( ForceIndexTableHint TableHintKey = "FORCE_INDEX" GroupScanByOptimization TableHintKey = "GROUPBY_SCAN_OPTIMIZATION" )
type TableName ¶
type TableName struct { Table *Ident Hint *Hint // optional As *AsAlias // optional Sample *TableSample // optional }
TableName is table name node in FROM clause.
{{.Table | sql}} {{.Hint | sqlOpt}} {{.As | sqlOpt}} {{.Sample | sqlOpt}}
type TablePrivilege ¶
type TablePrivilege interface { Node // contains filtered or unexported methods }
TablePrivilege represents privileges on table.
type TableSample ¶
type TableSample struct { TableSample token.Pos // position of "TABLESAMPLE" keyword Method TableSampleMethod Size *TableSampleSize }
TableSample is TABLESAMPLE clause node.
TABLESAMPLE {{.Method}} {{.Size | sql}}
func (*TableSample) End ¶
func (t *TableSample) End() token.Pos
func (*TableSample) Pos ¶
func (t *TableSample) Pos() token.Pos
func (*TableSample) SQL ¶
func (t *TableSample) SQL() string
type TableSampleMethod ¶
type TableSampleMethod string
const ( BernoulliSampleMethod TableSampleMethod = "BERNOULLI" ReservoirSampleMethod TableSampleMethod = "RESERVOIR" )
type TableSampleSize ¶
type TableSampleSize struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Value NumValue
Unit TableSampleUnit
}
TableSampleSize is size part of TABLESAMPLE clause.
({{.Value | sql}} {{.Unit}})
func (*TableSampleSize) End ¶
func (t *TableSampleSize) End() token.Pos
func (*TableSampleSize) Pos ¶
func (t *TableSampleSize) Pos() token.Pos
func (*TableSampleSize) SQL ¶
func (t *TableSampleSize) SQL() string
type TableSampleUnit ¶
type TableSampleUnit string
const ( PercentTableSampleUnit TableSampleUnit = "PERCENT" RowsTableSampleUnit TableSampleUnit = "ROWS" )
type TimestampLiteral ¶
type TimestampLiteral struct { Timestamp token.Pos // position of "TIMESTAMP" Value *StringLiteral }
TimestampLiteral is timestamp literal node.
TIMESTAMP {{.Value | sql}}
func (*TimestampLiteral) End ¶
func (t *TimestampLiteral) End() token.Pos
func (*TimestampLiteral) Pos ¶
func (t *TimestampLiteral) Pos() token.Pos
func (*TimestampLiteral) SQL ¶
func (t *TimestampLiteral) SQL() string
type Type ¶
type Type interface { Node // contains filtered or unexported methods }
Type represents type node.
type Unnest ¶
type Unnest struct { Unnest token.Pos // position of "UNNEST" Rparen token.Pos // position of ")" Implicit bool Expr Expr // Path or Ident when Implicit is true Hint *Hint // optional As *AsAlias // optional WithOffset *WithOffset // optional Sample *TableSample // optional }
Unnest is UNNEST call in FROM clause.
{{if .Implicit}}{{.Expr | sql}}{{else}}UNNEST({{.Expr | sql}}){{end}} {{.Hint | sqlOpt}} {{.As | sqlOpt}} {{.WithOffset | sqlOpt}} {{.Sample | sqlOpt}}
type UnnestInCondition ¶
UnnestInCondition is UNNEST call at IN condition.
UNNEST({{.Expr | sql}})
func (*UnnestInCondition) End ¶
func (u *UnnestInCondition) End() token.Pos
func (*UnnestInCondition) Pos ¶
func (u *UnnestInCondition) Pos() token.Pos
func (*UnnestInCondition) SQL ¶
func (u *UnnestInCondition) SQL() string
type Update ¶
type Update struct { Update token.Pos // position of "UPDATE" keyword TableName *Ident As *AsAlias // optional Updates []*UpdateItem // len(Updates) > 0 Where *Where }
Update is UPDATE statement.
UPDATE {{.TableName | sql}} {{.As | sqlOpt}} SET {{.Updates | sqlJoin ","}} {{.Where | sql}}
type UpdateItem ¶
UpdateItem is SET clause items in UPDATE.
{{.Path | sqlJoin "."}} = {{.Expr | sql}}
func (*UpdateItem) End ¶
func (u *UpdateItem) End() token.Pos
func (*UpdateItem) Pos ¶
func (u *UpdateItem) Pos() token.Pos
func (*UpdateItem) SQL ¶
func (u *UpdateItem) SQL() string
type UpdatePrivilege ¶
type UpdatePrivilege struct { Update token.Pos // position of "UPDATE" keyword Rparen token.Pos // position of ")" when len(Columns) > 0 Columns []*Ident }
UpdatePrivilege is UPDATE ON TABLE privilege node in GRANT and REVOKE.
UPDATE{{if .Columns}}({{.Columns | sqlJoin ","}}){{end}}
func (*UpdatePrivilege) End ¶
func (u *UpdatePrivilege) End() token.Pos
func (*UpdatePrivilege) Pos ¶
func (u *UpdatePrivilege) Pos() token.Pos
func (*UpdatePrivilege) SQL ¶
func (u *UpdatePrivilege) SQL() string
type Using ¶
type Using struct { Using token.Pos // position of "USING" keyword Rparen token.Pos // position of ")" Idents []*Ident // len(Idents) > 0 }
Using is Using condition of JOIN expression.
USING ({{Idents | sqlJoin ","}})
type ValuesInCondition ¶
type ValuesInCondition struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Exprs []Expr // len(Exprs) > 0
}
ValuesInCondition is parenthesized values at IN condition.
({{.Exprs | sqlJoin ","}})
func (*ValuesInCondition) End ¶
func (v *ValuesInCondition) End() token.Pos
func (*ValuesInCondition) Pos ¶
func (v *ValuesInCondition) Pos() token.Pos
func (*ValuesInCondition) SQL ¶
func (v *ValuesInCondition) SQL() string
type ValuesInput ¶
ValuesInput is VALUES clause in INSERT.
VALUES {{.Rows | sqlJoin ","}}
func (*ValuesInput) End ¶
func (v *ValuesInput) End() token.Pos
func (*ValuesInput) Pos ¶
func (v *ValuesInput) Pos() token.Pos
func (*ValuesInput) SQL ¶
func (v *ValuesInput) SQL() string
type ValuesRow ¶
type ValuesRow struct {
Lparen, Rparen token.Pos // position of "(" and ")"
Exprs []*DefaultExpr
}
ValuesRow is row values of VALUES clause.
({{.Exprs | sqlJoin ","}})
type WithOffset ¶
type WithOffset struct {
With, Offset token.Pos // position of "WITH" and "OFFSET" keywords
As *AsAlias // optional
}
WithOffset is WITH OFFSET clause node after UNNEST call.
WITH OFFSET {{.As | sqlOpt}}
func (*WithOffset) End ¶
func (w *WithOffset) End() token.Pos
func (*WithOffset) Pos ¶
func (w *WithOffset) Pos() token.Pos
func (*WithOffset) SQL ¶
func (w *WithOffset) SQL() string