parser

package
v1.18.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EOF = -(iota + 1)
	Uncategorized
)
View Source
const (
	TokenFrom   = IDENTIFIER
	TokenTo     = SUBSTITUTION_OP
	KeywordFrom = SELECT
	KeywordTo   = JSON_OBJECT
)
View Source
const (
	VariableSign            = '@'
	EnvironmentVariableSign = '%'
	ExternalCommandSign     = '$'
	RuntimeInformationSign  = '#'

	SubstitutionOperator = ":="

	BeginExpression = '{'
	EndExpression   = '}'

	IdentifierDelimiter = ':'
)
View Source
const ABSOLUTE = 57451
View Source
const ADD = 57378
View Source
const AFTER = 57384
View Source
const AGGREGATE = 57473
View Source
const AGGREGATE_FUNCTION = 57496
View Source
const ALL = 57413
View Source
const ALTER = 57380
View Source
const ANALYTIC_FUNCTION = 57498
View Source
const AND = 57417
View Source
const ANY = 57414
View Source
const AS = 57373
View Source
const ASC = 57394
View Source
const BEFORE = 57385
View Source
const BEGIN = 57474
View Source
const BETWEEN = 57420
View Source
const BOOLEAN = 57350
View Source
const BREAK = 57459
View Source
const BY = 57393
View Source
const CASE = 57432
View Source
const CHDIR = 57466
View Source
const CLOSE = 57446
View Source
const COMMIT = 57456
View Source
const COMPARISON_OP = 57501
View Source
const CONSTANT = 57359
View Source
const CONTINUE = 57458
View Source
const COUNT = 57494
View Source
const CREATE = 57377
View Source
const CROSS = 57405
View Source
const CSV = 57484
View Source
const CSV_INLINE = 57489
View Source
const CURRENT = 57430
View Source
const CURSOR = 57442
View Source
const DATETIME = 57352
View Source
const DECLARE = 57441
View Source
const DEFAULT = 57386
View Source
const DELETE = 57367
View Source
const DESC = 57395
View Source
const DISPOSE = 57447
View Source
const DISTINCT = 57424
View Source
const DO = 57439
View Source
const DROP = 57379
View Source
const DUAL = 57374
View Source
const ECHO = 57461
View Source
const ELSE = 57438
View Source
const ELSEIF = 57434
View Source
const END = 57440
View Source
const ENVIRONMENT_VARIABLE = 57355
View Source
const EXCEPT = 57412
View Source
const EXECUTE = 57465
View Source
const EXISTS = 57415
View Source
const EXIT = 57460
View Source
const EXTERNAL_COMMAND = 57357
View Source
const FETCH = 57444
View Source
const FIRST = 57382
View Source
const FIXED = 57487
View Source
const FLAG = 57354
View Source
const FLOAT = 57349
View Source
const FOLLOWING = 57429
View Source
const FOR = 57443
View Source
const FROM = 57363
View Source
const FULL = 57404
View Source
const FUNCTION = 57472
View Source
const FUNCTION_NTH = 57499
View Source
const FUNCTION_WITH_INS = 57500
View Source
const GROUP = 57391
View Source
const HAVING = 57392
View Source
const IDENTIFIER = 57346
View Source
const IF = 57433
View Source
const IGNORE = 57476
View Source
const IN = 57416
View Source
const INNER = 57400
View Source
const INSERT = 57369
View Source
const INTEGER = 57348
View Source
const INTERSECT = 57411
View Source
const INTO = 57370
View Source
const IS = 57422
View Source
const JOIN = 57399
View Source
const JSON = 57485
View Source
const JSONL = 57486
View Source
const JSON_INLINE = 57490
View Source
const JSON_OBJECT = 57495
View Source
const JSON_ROW = 57492
View Source
const JSON_TABLE = 57491
View Source
const LAST = 57383
View Source
const LATERAL = 57409
View Source
const LEFT = 57402
View Source
const LIKE = 57421
View Source
const LIMIT = 57396
View Source
const LIST_FUNCTION = 57497
View Source
const LTSV = 57488
View Source
const NATURAL = 57408
View Source
const NEXT = 57449
View Source
const NOT = 57419
View Source
const NULL = 57423
View Source
const NULLS = 57481
View Source
const OFFSET = 57397
View Source
const ON = 57406
View Source
const ONLY = 57483
View Source
const OPEN = 57445
View Source
const OR = 57418
View Source
const ORDER = 57390
View Source
const OUTER = 57401
View Source
const OVER = 57455
View Source
const PARTITION = 57454
View Source
const PERCENT = 57398
View Source
const PLACEHOLDER = 57358
View Source
const PRECEDING = 57428
View Source
const PREPARE = 57448
View Source
const PRINT = 57462
View Source
const PRINTF = 57463
View Source
const PRIOR = 57450
View Source
const PWD = 57467
View Source
const RANGE = 57426
View Source
const RECURSIVE = 57376
View Source
const RELATIVE = 57452
View Source
const RELOAD = 57468
View Source
const REMOVE = 57469
View Source
const RENAME = 57387
View Source
const REPLACE = 57372
View Source
const RETURN = 57475
View Source
const RIGHT = 57403
View Source
const ROLLBACK = 57457
View Source
const ROW = 57431
View Source
const ROWS = 57482
View Source
const RUNTIME_INFORMATION = 57356
View Source
const SELECT = 57362
View Source
const SEPARATOR = 57453
View Source
const SET = 57365
View Source
const SHOW = 57479
View Source
const SOURCE = 57464
View Source
const STDIN = 57375
View Source
const STRING = 57347
View Source
const STRING_OP = 57502
View Source
const SUBSTITUTION_OP = 57503
View Source
const SUBSTRING = 57493
View Source
const SYNTAX = 57470
View Source
const TABLE = 57381
View Source
const TABLE_FUNCTION = 57360
View Source
const TERNARY = 57351
View Source
const THEN = 57437
View Source
const TIES = 57480
View Source
const TO = 57388
View Source
const TRIGGER = 57471
View Source
const TokenUndefined = 0
View Source
const UMINUS = 57504
View Source
const UNBOUNDED = 57427
View Source
const UNION = 57410
View Source
const UNSET = 57366
View Source
const UPDATE = 57364
View Source
const UPLUS = 57505
View Source
const URL = 57361
View Source
const USING = 57407
View Source
const VALUES = 57371
View Source
const VAR = 57478
View Source
const VARIABLE = 57353
View Source
const VIEW = 57389
View Source
const WHEN = 57436
View Source
const WHERE = 57368
View Source
const WHILE = 57435
View Source
const WITH = 57425
View Source
const WITHIN = 57477

Variables

Functions

func KeywordLiteral

func KeywordLiteral(token int) (string, error)

func NewSyntaxError

func NewSyntaxError(message string, token Token) error

func SetDebugLevel

func SetDebugLevel(level int, verbose bool)

func TokenLiteral

func TokenLiteral(token int) string

Types

type AddColumns

type AddColumns struct {
	*BaseExpr
	Table    QueryExpression
	Columns  []ColumnDefault
	Position Expression
}

type AddFlagElement

type AddFlagElement struct {
	*BaseExpr
	Flag  Flag
	Value QueryExpression
}

type AggregateDeclaration

type AggregateDeclaration struct {
	*BaseExpr
	Name       Identifier
	Cursor     Identifier
	Parameters []VariableAssignment
	Statements []Statement
}

type AggregateFunction

type AggregateFunction struct {
	*BaseExpr
	Name     string
	Distinct Token
	Args     []QueryExpression
}

func (AggregateFunction) IsDistinct

func (e AggregateFunction) IsDistinct() bool

func (AggregateFunction) String

func (e AggregateFunction) String() string

type All

type All struct {
	*BaseExpr
	LHS      QueryExpression
	Operator Token
	Values   QueryExpression
}

func (All) String

func (a All) String() string

type AllColumns

type AllColumns struct {
	*BaseExpr
}

func (AllColumns) String

func (ac AllColumns) String() string

type AnalyticClause

type AnalyticClause struct {
	*BaseExpr
	PartitionClause QueryExpression
	OrderByClause   QueryExpression
	WindowingClause QueryExpression
}

func (AnalyticClause) PartitionValues

func (e AnalyticClause) PartitionValues() []QueryExpression

func (AnalyticClause) String

func (e AnalyticClause) String() string

type AnalyticFunction

type AnalyticFunction struct {
	*BaseExpr
	Name           string
	Distinct       Token
	Args           []QueryExpression
	IgnoreType     Token
	AnalyticClause AnalyticClause
}

func (AnalyticFunction) IgnoreNulls

func (e AnalyticFunction) IgnoreNulls() bool

func (AnalyticFunction) IsDistinct

func (e AnalyticFunction) IsDistinct() bool

func (AnalyticFunction) String

func (e AnalyticFunction) String() string

type Any

type Any struct {
	*BaseExpr
	LHS      QueryExpression
	Operator Token
	Values   QueryExpression
}

func (Any) String

func (a Any) String() string

type Arithmetic

type Arithmetic struct {
	*BaseExpr
	LHS      QueryExpression
	Operator Token
	RHS      QueryExpression
}

func (Arithmetic) String

func (a Arithmetic) String() string

type BaseExpr

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

func NewBaseExpr

func NewBaseExpr(token Token) *BaseExpr

func (*BaseExpr) Char

func (e *BaseExpr) Char() int

func (*BaseExpr) ClearBaseExpr

func (e *BaseExpr) ClearBaseExpr()

func (*BaseExpr) GetBaseExpr

func (e *BaseExpr) GetBaseExpr() *BaseExpr

func (*BaseExpr) HasParseInfo

func (e *BaseExpr) HasParseInfo() bool

func (*BaseExpr) Line

func (e *BaseExpr) Line() int

func (*BaseExpr) SourceFile

func (e *BaseExpr) SourceFile() string

type Between

type Between struct {
	*BaseExpr
	LHS      QueryExpression
	Low      QueryExpression
	High     QueryExpression
	Negation Token
}

func (Between) IsNegated

func (b Between) IsNegated() bool

func (Between) String

func (b Between) String() string

type Case

type Case struct {
	*BaseExpr
	Value QueryExpression
	When  []CaseWhen
	Else  CaseElse
}

type CaseElse

type CaseElse struct {
	*BaseExpr
	Statements []Statement
}

type CaseExpr

type CaseExpr struct {
	*BaseExpr
	Value QueryExpression
	When  []QueryExpression
	Else  QueryExpression
}

func (CaseExpr) String

func (e CaseExpr) String() string

type CaseExprElse

type CaseExprElse struct {
	*BaseExpr
	Result QueryExpression
}

func (CaseExprElse) String

func (e CaseExprElse) String() string

type CaseExprWhen

type CaseExprWhen struct {
	*BaseExpr
	Condition QueryExpression
	Result    QueryExpression
}

func (CaseExprWhen) String

func (e CaseExprWhen) String() string

type CaseWhen

type CaseWhen struct {
	*BaseExpr
	Condition  QueryExpression
	Statements []Statement
}

type Chdir

type Chdir struct {
	*BaseExpr
	DirPath QueryExpression
}

type CloseCursor

type CloseCursor struct {
	*BaseExpr
	Cursor Identifier
}

type ColumnDefault

type ColumnDefault struct {
	*BaseExpr
	Column Identifier
	Value  QueryExpression
}

type ColumnNumber

type ColumnNumber struct {
	*BaseExpr
	View   Identifier
	Number *value.Integer
}

func (ColumnNumber) String

func (e ColumnNumber) String() string

type ColumnPosition

type ColumnPosition struct {
	*BaseExpr
	Position Token
	Column   QueryExpression
}

type Comparison

type Comparison struct {
	*BaseExpr
	LHS      QueryExpression
	Operator Token
	RHS      QueryExpression
}

func (Comparison) String

func (c Comparison) String() string

type Concat

type Concat struct {
	*BaseExpr
	Items []QueryExpression
}

func (Concat) String

func (c Concat) String() string

type Constant

type Constant struct {
	*BaseExpr
	Space string
	Name  string
}

func (Constant) String

func (e Constant) String() string

type CreateTable

type CreateTable struct {
	*BaseExpr
	Table       Identifier
	Fields      []QueryExpression
	Query       QueryExpression
	IfNotExists bool
}

type CursorAttrebute

type CursorAttrebute struct {
	*BaseExpr
	Cursor    Identifier
	Attrebute Token
}

func (CursorAttrebute) String

func (e CursorAttrebute) String() string

type CursorDeclaration

type CursorDeclaration struct {
	*BaseExpr
	Cursor    Identifier
	Query     SelectQuery
	Statement Identifier
}

type CursorStatus

type CursorStatus struct {
	*BaseExpr
	Cursor   Identifier
	Negation Token
	Type     Token
}

func (CursorStatus) String

func (e CursorStatus) String() string

type DeleteQuery

type DeleteQuery struct {
	*BaseExpr
	WithClause  QueryExpression
	Tables      []QueryExpression
	FromClause  FromClause
	WhereClause QueryExpression
}

type DisposeCursor

type DisposeCursor struct {
	*BaseExpr
	Cursor Identifier
}

type DisposeFunction

type DisposeFunction struct {
	*BaseExpr
	Name Identifier
}

type DisposeStatement

type DisposeStatement struct {
	*BaseExpr
	Name Identifier
}

type DisposeVariable

type DisposeVariable struct {
	*BaseExpr
	Variable Variable
}

type DisposeView

type DisposeView struct {
	*BaseExpr
	View QueryExpression
}

type DropColumns

type DropColumns struct {
	*BaseExpr
	Table   QueryExpression
	Columns []QueryExpression
}

type Dual

type Dual struct {
	*BaseExpr
}

func (Dual) String

func (d Dual) String() string

type Echo

type Echo struct {
	*BaseExpr
	Value QueryExpression
}

type Else

type Else struct {
	*BaseExpr
	Statements []Statement
}

type ElseIf

type ElseIf struct {
	*BaseExpr
	Condition  QueryExpression
	Statements []Statement
}

type EnvironmentVariable

type EnvironmentVariable struct {
	*BaseExpr
	Name   string
	Quoted bool
}

func (EnvironmentVariable) String

func (e EnvironmentVariable) String() string

type Execute

type Execute struct {
	*BaseExpr
	Statements QueryExpression
	Values     []QueryExpression
}

type ExecuteStatement

type ExecuteStatement struct {
	*BaseExpr
	Name   Identifier
	Values []ReplaceValue
}

type Exists

type Exists struct {
	*BaseExpr
	Query Subquery
}

func (Exists) String

func (e Exists) String() string

type Exit

type Exit struct {
	*BaseExpr
	Code value.Primary
}

type Expression

type Expression interface {
	GetBaseExpr() *BaseExpr
	ClearBaseExpr()
	HasParseInfo() bool
	Line() int
	Char() int
	SourceFile() string
}

type ExternalCommand

type ExternalCommand struct {
	*BaseExpr
	Command string
}

type FetchCursor

type FetchCursor struct {
	*BaseExpr
	Position  FetchPosition
	Cursor    Identifier
	Variables []Variable
}

type FetchPosition

type FetchPosition struct {
	*BaseExpr
	Position Token
	Number   QueryExpression
}

type Field

type Field struct {
	*BaseExpr
	Object QueryExpression
	As     Token
	Alias  QueryExpression
}

func (Field) Name

func (f Field) Name() string

func (Field) String

func (f Field) String() string

type FieldReference

type FieldReference struct {
	*BaseExpr
	View   Identifier
	Column QueryExpression
}

func (FieldReference) String

func (e FieldReference) String() string

type Flag

type Flag struct {
	*BaseExpr
	Name string
}

func (Flag) String

func (e Flag) String() string

type FlowControl

type FlowControl struct {
	*BaseExpr
	Token int
}

type FormatSpecifiedFunction

type FormatSpecifiedFunction struct {
	*BaseExpr
	Type          Token
	FormatElement QueryExpression
	Path          QueryExpression
	Args          []QueryExpression
}

func (FormatSpecifiedFunction) String

func (e FormatSpecifiedFunction) String() string

type FromClause

type FromClause struct {
	*BaseExpr
	Tables []QueryExpression
}

func (FromClause) String

func (f FromClause) String() string

type Function

type Function struct {
	*BaseExpr
	Name string
	Args []QueryExpression
	From Token
	For  Token
}

func (Function) String

func (e Function) String() string

type FunctionDeclaration

type FunctionDeclaration struct {
	*BaseExpr
	Name       Identifier
	Parameters []VariableAssignment
	Statements []Statement
}

type GroupByClause

type GroupByClause struct {
	*BaseExpr
	Items []QueryExpression
}

func (GroupByClause) String

func (gb GroupByClause) String() string

type HavingClause

type HavingClause struct {
	*BaseExpr
	Filter QueryExpression
}

func (HavingClause) String

func (h HavingClause) String() string

type Identifier

type Identifier struct {
	*BaseExpr
	Literal string
	Quoted  bool
}

func (Identifier) String

func (i Identifier) String() string

type If

type If struct {
	*BaseExpr
	Condition  QueryExpression
	Statements []Statement
	ElseIf     []ElseIf
	Else       Else
}

type In

type In struct {
	*BaseExpr
	LHS      QueryExpression
	Values   QueryExpression
	Negation Token
}

func (In) IsNegated

func (i In) IsNegated() bool

func (In) String

func (i In) String() string

type InlineTable

type InlineTable struct {
	*BaseExpr
	Recursive Token
	Name      Identifier
	Fields    []QueryExpression
	Query     SelectQuery
}

func (InlineTable) IsRecursive

func (e InlineTable) IsRecursive() bool

func (InlineTable) String

func (e InlineTable) String() string

type InsertQuery

type InsertQuery struct {
	*BaseExpr
	WithClause QueryExpression
	Table      Table
	Fields     []QueryExpression
	ValuesList []QueryExpression
	Query      QueryExpression
}

type IntoClause

type IntoClause struct {
	*BaseExpr
	Variables []Variable
}

func (IntoClause) String

func (e IntoClause) String() string

type Is

type Is struct {
	*BaseExpr
	LHS      QueryExpression
	RHS      QueryExpression
	Negation Token
}

func (Is) IsNegated

func (i Is) IsNegated() bool

func (Is) String

func (i Is) String() string

type Join

type Join struct {
	*BaseExpr
	Table     QueryExpression
	JoinTable QueryExpression
	Natural   Token
	JoinType  Token
	Direction Token
	Condition QueryExpression
}

func (Join) String

func (j Join) String() string

type JoinCondition

type JoinCondition struct {
	*BaseExpr
	On    QueryExpression
	Using []QueryExpression
}

func (JoinCondition) String

func (jc JoinCondition) String() string

type JsonQuery

type JsonQuery struct {
	*BaseExpr
	JsonQuery Token
	Query     QueryExpression
	JsonText  QueryExpression
}

func (JsonQuery) String

func (e JsonQuery) String() string

type Lexer

type Lexer struct {
	Scanner
	// contains filtered or unexported fields
}

func (*Lexer) Error

func (l *Lexer) Error(e string)

func (*Lexer) Lex

func (l *Lexer) Lex(lval *yySymType) int

type Like

type Like struct {
	*BaseExpr
	LHS      QueryExpression
	Pattern  QueryExpression
	Negation Token
}

func (Like) IsNegated

func (l Like) IsNegated() bool

func (Like) String

func (l Like) String() string

type LimitClause

type LimitClause struct {
	*BaseExpr
	Type         Token
	Position     Token
	Value        QueryExpression
	Unit         Token
	Restriction  Token
	OffsetClause QueryExpression
}

func (LimitClause) Percentage

func (e LimitClause) Percentage() bool

func (LimitClause) String

func (e LimitClause) String() string

func (LimitClause) WithTies

func (e LimitClause) WithTies() bool

type ListFunction

type ListFunction struct {
	*BaseExpr
	Name     string
	Distinct Token
	Args     []QueryExpression
	OrderBy  QueryExpression
}

func (ListFunction) IsDistinct

func (e ListFunction) IsDistinct() bool

func (ListFunction) String

func (e ListFunction) String() string

type Logic

type Logic struct {
	*BaseExpr
	LHS      QueryExpression
	Operator Token
	RHS      QueryExpression
}

func (Logic) String

func (l Logic) String() string

type OffsetClause

type OffsetClause struct {
	*BaseExpr
	Value QueryExpression
	Unit  Token
}

func (OffsetClause) String

func (e OffsetClause) String() string

type OpenCursor

type OpenCursor struct {
	*BaseExpr
	Cursor Identifier
	Values []ReplaceValue
}

type OrderByClause

type OrderByClause struct {
	*BaseExpr
	Items []QueryExpression
}

func (OrderByClause) String

func (ob OrderByClause) String() string

type OrderItem

type OrderItem struct {
	*BaseExpr
	Value         QueryExpression
	Direction     Token
	NullsPosition Token
}

func (OrderItem) String

func (e OrderItem) String() string

type Parentheses

type Parentheses struct {
	*BaseExpr
	Expr QueryExpression
}

func (Parentheses) String

func (p Parentheses) String() string

type PartitionClause

type PartitionClause struct {
	*BaseExpr
	Values []QueryExpression
}

func (PartitionClause) String

func (e PartitionClause) String() string

type Placeholder

type Placeholder struct {
	*BaseExpr
	Literal string
	Ordinal int
	Name    string
}

func (Placeholder) String

func (e Placeholder) String() string

type PrimitiveType

type PrimitiveType struct {
	*BaseExpr
	Literal string
	Value   value.Primary
}

func NewDatetimeValue

func NewDatetimeValue(t time.Time) PrimitiveType

func NewDatetimeValueFromString

func NewDatetimeValueFromString(s string, formats []string, location *time.Location) PrimitiveType

func NewFloatValue

func NewFloatValue(f float64) PrimitiveType

func NewFloatValueFromString

func NewFloatValueFromString(s string) PrimitiveType

func NewIntegerValue

func NewIntegerValue(i int64) PrimitiveType

func NewIntegerValueFromString

func NewIntegerValueFromString(s string) PrimitiveType

func NewNullValue

func NewNullValue() PrimitiveType

func NewStringValue

func NewStringValue(s string) PrimitiveType

func NewTernaryValue

func NewTernaryValue(t ternary.Value) PrimitiveType

func NewTernaryValueFromString

func NewTernaryValueFromString(s string) PrimitiveType

func (PrimitiveType) IsInteger

func (e PrimitiveType) IsInteger() bool

func (PrimitiveType) String

func (e PrimitiveType) String() string

type Print

type Print struct {
	*BaseExpr
	Value QueryExpression
}

type Printf

type Printf struct {
	*BaseExpr
	Format QueryExpression
	Values []QueryExpression
}

type Pwd

type Pwd struct {
	*BaseExpr
}

type QueryExpression

type QueryExpression interface {
	String() string

	GetBaseExpr() *BaseExpr
	ClearBaseExpr()
	HasParseInfo() bool
	Line() int
	Char() int
	SourceFile() string
}

type Reload

type Reload struct {
	*BaseExpr
	Type Identifier
}

type RemoveFlagElement

type RemoveFlagElement struct {
	*BaseExpr
	Flag  Flag
	Value QueryExpression
}

type RenameColumn

type RenameColumn struct {
	*BaseExpr
	Table QueryExpression
	Old   QueryExpression
	New   Identifier
}

type ReplaceQuery

type ReplaceQuery struct {
	*BaseExpr
	WithClause QueryExpression
	Table      Table
	Fields     []QueryExpression
	Keys       []QueryExpression
	ValuesList []QueryExpression
	Query      QueryExpression
}

type ReplaceValue

type ReplaceValue struct {
	*BaseExpr
	Value QueryExpression
	Name  Identifier
}

type Return

type Return struct {
	*BaseExpr
	Value QueryExpression
}

type RowValue

type RowValue struct {
	*BaseExpr
	Value QueryExpression
}

func (RowValue) String

func (e RowValue) String() string

type RowValueList

type RowValueList struct {
	*BaseExpr
	RowValues []QueryExpression
}

func (RowValueList) String

func (e RowValueList) String() string

type RuntimeInformation

type RuntimeInformation struct {
	*BaseExpr
	Name string
}

func (RuntimeInformation) String

func (e RuntimeInformation) String() string

type Scanner

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

func (*Scanner) HolderNumber

func (s *Scanner) HolderNumber() int

func (*Scanner) Init

func (s *Scanner) Init(src string, sourceFile string, forPrepared bool, ansiQuotes bool) *Scanner

func (*Scanner) Scan

func (s *Scanner) Scan() (Token, error)

type SelectClause

type SelectClause struct {
	*BaseExpr
	Distinct Token
	Fields   []QueryExpression
}

func (SelectClause) IsDistinct

func (sc SelectClause) IsDistinct() bool

func (SelectClause) String

func (sc SelectClause) String() string

type SelectEntity

type SelectEntity struct {
	*BaseExpr
	SelectClause  QueryExpression
	IntoClause    QueryExpression
	FromClause    QueryExpression
	WhereClause   QueryExpression
	GroupByClause QueryExpression
	HavingClause  QueryExpression
}

func (SelectEntity) String

func (e SelectEntity) String() string

type SelectQuery

type SelectQuery struct {
	*BaseExpr
	WithClause    QueryExpression
	SelectEntity  QueryExpression
	OrderByClause QueryExpression
	LimitClause   QueryExpression
	Context       Token
}

func (SelectQuery) IsForUpdate

func (e SelectQuery) IsForUpdate() bool

func (SelectQuery) String

func (e SelectQuery) String() string

type SelectSet

type SelectSet struct {
	*BaseExpr
	LHS      QueryExpression
	Operator Token
	All      Token
	RHS      QueryExpression
}

func (SelectSet) String

func (e SelectSet) String() string

type SetEnvVar

type SetEnvVar struct {
	*BaseExpr
	EnvVar EnvironmentVariable
	Value  QueryExpression
}

type SetFlag

type SetFlag struct {
	*BaseExpr
	Flag  Flag
	Value QueryExpression
}

type SetTableAttribute

type SetTableAttribute struct {
	*BaseExpr
	Table     QueryExpression
	Attribute Identifier
	Value     QueryExpression
}

type ShowFields

type ShowFields struct {
	*BaseExpr
	Type  Identifier
	Table QueryExpression
}

type ShowFlag

type ShowFlag struct {
	*BaseExpr
	Flag Flag
}

type ShowObjects

type ShowObjects struct {
	*BaseExpr
	Type Identifier
}

type Source

type Source struct {
	*BaseExpr
	FilePath QueryExpression
}

type Statement

type Statement interface{}

func Parse

func Parse(s string, sourceFile string, forPrepared bool, ansiQuotes bool) ([]Statement, int, error)

type StatementPreparation

type StatementPreparation struct {
	*BaseExpr
	Name      Identifier
	Statement *value.String
}

type Stdin

type Stdin struct {
	*BaseExpr
}

func (Stdin) String

func (si Stdin) String() string

type Subquery

type Subquery struct {
	*BaseExpr
	Query SelectQuery
}

func (Subquery) String

func (e Subquery) String() string

type Syntax

type Syntax struct {
	*BaseExpr
	Keywords []QueryExpression
}

type SyntaxError

type SyntaxError struct {
	SourceFile string
	Line       int
	Char       int
	Message    string
}

func (SyntaxError) Error

func (e SyntaxError) Error() string

type Table

type Table struct {
	*BaseExpr
	Lateral Token
	Object  QueryExpression
	As      Token
	Alias   QueryExpression
}

func (Table) String

func (e Table) String() string

type TableFunction

type TableFunction struct {
	*BaseExpr
	Name string
	Args []QueryExpression
}

func (TableFunction) String

func (e TableFunction) String() string

type Token

type Token struct {
	Token         int
	Literal       string
	Quoted        bool
	HolderOrdinal int
	Line          int
	Char          int
	SourceFile    string
}

func (Token) IsEmpty

func (t Token) IsEmpty() bool

func (Token) String

func (t Token) String() string

type TransactionControl

type TransactionControl struct {
	*BaseExpr
	Token int
}

type Trigger

type Trigger struct {
	*BaseExpr
	Event   Identifier
	Message QueryExpression
	Code    value.Primary
}

type UnaryArithmetic

type UnaryArithmetic struct {
	*BaseExpr
	Operand  QueryExpression
	Operator Token
}

func (UnaryArithmetic) String

func (e UnaryArithmetic) String() string

type UnaryLogic

type UnaryLogic struct {
	*BaseExpr
	Operand  QueryExpression
	Operator Token
}

func (UnaryLogic) String

func (e UnaryLogic) String() string

type UnsetEnvVar

type UnsetEnvVar struct {
	*BaseExpr
	EnvVar EnvironmentVariable
}

type UpdateQuery

type UpdateQuery struct {
	*BaseExpr
	WithClause  QueryExpression
	Tables      []QueryExpression
	SetList     []UpdateSet
	FromClause  QueryExpression
	WhereClause QueryExpression
}

type UpdateSet

type UpdateSet struct {
	*BaseExpr
	Field QueryExpression
	Value QueryExpression
}

type Url

type Url struct {
	*BaseExpr
	Raw string
}

func (Url) String

func (e Url) String() string

type ValueList

type ValueList struct {
	*BaseExpr
	Values []QueryExpression
}

func (ValueList) String

func (e ValueList) String() string

type Variable

type Variable struct {
	*BaseExpr
	Name string
}

func (Variable) String

func (v Variable) String() string

type VariableAssignment

type VariableAssignment struct {
	*BaseExpr
	Variable Variable
	Value    QueryExpression
}

type VariableDeclaration

type VariableDeclaration struct {
	*BaseExpr
	Assignments []VariableAssignment
}

type VariableSubstitution

type VariableSubstitution struct {
	*BaseExpr
	Variable Variable
	Value    QueryExpression
}

func (VariableSubstitution) String

func (vs VariableSubstitution) String() string

type ViewDeclaration

type ViewDeclaration struct {
	*BaseExpr
	View   Identifier
	Fields []QueryExpression
	Query  QueryExpression
}

type WhereClause

type WhereClause struct {
	*BaseExpr
	Filter QueryExpression
}

func (WhereClause) String

func (w WhereClause) String() string

type While

type While struct {
	*BaseExpr
	Condition  QueryExpression
	Statements []Statement
}

type WhileInCursor

type WhileInCursor struct {
	*BaseExpr
	WithDeclaration bool
	Variables       []Variable
	Cursor          Identifier
	Statements      []Statement
}

type WindowFramePosition

type WindowFramePosition struct {
	*BaseExpr
	Direction Token
	Unbounded Token
	Offset    int
}

func (WindowFramePosition) String

func (e WindowFramePosition) String() string

type WindowingClause

type WindowingClause struct {
	*BaseExpr
	FrameLow  QueryExpression
	FrameHigh QueryExpression
}

func (WindowingClause) String

func (e WindowingClause) String() string

type WithClause

type WithClause struct {
	*BaseExpr
	InlineTables []QueryExpression
}

func (WithClause) String

func (e WithClause) String() string

Jump to

Keyboard shortcuts

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