parser

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2017 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EOF = -(iota + 1)
	UNCATEGORIZED
)
View Source
const (
	TOKEN_FROM   = IDENTIFIER
	TOKEN_TO     = SUBSTITUTION_OP
	KEYWORD_FROM = SELECT
	KEYWORD_TO   = LISTAGG
)
View Source
const (
	VARIABLE_SIGN = '@'

	SUBSTITUTION_OPERATOR = ":="
)
View Source
const ABSOLUTE = 57433
View Source
const ADD = 57369
View Source
const AFTER = 57375
View Source
const AGGREGATE = 57449
View Source
const AGGREGATE_FUNCTION = 57460
View Source
const ALL = 57402
View Source
const ALTER = 57371
View Source
const AND = 57406
View Source
const ANY = 57403
View Source
const AS = 57364
View Source
const ASC = 57384
View Source
const BEFORE = 57376
View Source
const BEGIN = 57450
View Source
const BETWEEN = 57409
View Source
const BOOLEAN = 57350
View Source
const BREAK = 57442
View Source
const BY = 57383
View Source
const CASE = 57415
View Source
const CLOSE = 57429
View Source
const COMMIT = 57439
View Source
const COMPARISON_OP = 57462
View Source
const CONTINUE = 57441
View Source
const COUNT = 57458
View Source
const CREATE = 57368
View Source
const CROSS = 57395
View Source
const CURSOR = 57425
View Source
const DATETIME = 57352
View Source
const DECLARE = 57424
View Source
const DEFAULT = 57377
View Source
const DEFAULT_DATETIME_FORMAT = "2006-01-02 15:04:05.999999999"
View Source
const DELETE = 57359
View Source
const DESC = 57385
View Source
const DISPOSE = 57430
View Source
const DISTINCT = 57413
View Source
const DO = 57422
View Source
const DROP = 57370
View Source
const DUAL = 57365
View Source
const ELSE = 57421
View Source
const ELSEIF = 57417
View Source
const END = 57423
View Source
const ERROR = 57457
View Source
const EXCEPT = 57401
View Source
const EXISTS = 57404
View Source
const EXIT = 57443
View Source
const FETCH = 57427
View Source
const FIRST = 57373
View Source
const FLAG = 57354
View Source
const FLOAT = 57349
View Source
const FOR = 57426
View Source
const FROM = 57356
View Source
const FULL = 57394
View Source
const FUNCTION = 57448
View Source
const FUNCTION_WITH_INS = 57461
View Source
const GROUP = 57381
View Source
const HAVING = 57382
View Source
const IDENTIFIER = 57346
View Source
const IF = 57416
View Source
const IGNORE = 57452
View Source
const IN = 57405
View Source
const INNER = 57390
View Source
const INSERT = 57361
View Source
const INTEGER = 57348
View Source
const INTERSECT = 57400
View Source
const INTO = 57362
View Source
const IS = 57411
View Source
const JOIN = 57389
View Source
const LAST = 57374
View Source
const LEFT = 57392
View Source
const LIKE = 57410
View Source
const LIMIT = 57386
View Source
const LISTAGG = 57459
View Source
const NATURAL = 57398
View Source
const NEXT = 57431
View Source
const NOT = 57408
View Source
const NULL = 57412
View Source
const NULLS = 57456
View Source
const OFFSET = 57387
View Source
const ON = 57396
View Source
const OPEN = 57428
View Source
const OR = 57407
View Source
const ORDER = 57380
View Source
const OUTER = 57391
View Source
const OVER = 57438
View Source
const PARTITION = 57437
View Source
const PERCENT = 57388
View Source
const PRINT = 57444
View Source
const PRINTF = 57445
View Source
const PRIOR = 57432
View Source
const RANGE = 57435
View Source
const RECURSIVE = 57367
View Source
const RELATIVE = 57434
View Source
const RENAME = 57378
View Source
const RETURN = 57451
View Source
const RIGHT = 57393
View Source
const ROLLBACK = 57440
View Source
const SELECT = 57355
View Source
const SEPARATOR = 57436
View Source
const SET = 57358
View Source
const SOURCE = 57446
View Source
const STDIN = 57366
View Source
const STRING = 57347
View Source
const STRING_OP = 57463
View Source
const SUBSTITUTION_OP = 57464
View Source
const TABLE = 57372
View Source
const TERNARY = 57351
View Source
const THEN = 57420
View Source
const TIES = 57455
View Source
const TO = 57379
View Source
const TOKEN_UNDEFINED = 0
View Source
const TRIGGER = 57447
View Source
const UMINUS = 57465
View Source
const UNION = 57399
View Source
const UPDATE = 57357
View Source
const UPLUS = 57466
View Source
const USING = 57397
View Source
const VALUES = 57363
View Source
const VAR = 57454
View Source
const VARIABLE = 57353
View Source
const WHEN = 57419
View Source
const WHERE = 57360
View Source
const WHILE = 57418
View Source
const WITH = 57414
View Source
const WITHIN = 57453

Variables

This section is empty.

Functions

func ConvertDatetimeFormat added in v0.2.7

func ConvertDatetimeFormat(format string) string

func Float64ToStr

func Float64ToStr(f float64) string

func FormatTableName added in v0.1.6

func FormatTableName(s string) string

func Int64ToStr

func Int64ToStr(i int64) string

func IsNull

func IsNull(v Primary) bool

func IsPrimary

func IsPrimary(e Expression) bool

func NewSyntaxError added in v0.4.3

func NewSyntaxError(message string, token Token) error

func SetDebugLevel

func SetDebugLevel(level int, verbose bool)

func StrToTime

func StrToTime(s string) (time.Time, error)

func TokenLiteral

func TokenLiteral(token int) string

Types

type AddColumns added in v0.1.6

type AddColumns struct {
	*BaseExpr
	AlterTable string
	Table      Expression
	Add        string
	Columns    []Expression
	Position   Expression
}

func (AddColumns) String added in v0.1.6

func (e AddColumns) String() string

type AggregateDeclaration added in v0.4.10

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

type AggregateFunction added in v0.4.0

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

func (AggregateFunction) IsDistinct added in v0.4.9

func (e AggregateFunction) IsDistinct() bool

func (AggregateFunction) String added in v0.4.0

func (e AggregateFunction) String() string

type All

type All struct {
	*BaseExpr
	All      string
	LHS      Expression
	Operator string
	Values   Expression
}

func (All) String

func (a All) String() string

type AllColumns

type AllColumns struct {
	*BaseExpr
}

func (AllColumns) String

func (ac AllColumns) String() string

type AnalyticClause added in v0.2.3

type AnalyticClause struct {
	*BaseExpr
	Partition     Expression
	OrderByClause Expression
}

func (AnalyticClause) OrderValues added in v0.2.3

func (e AnalyticClause) OrderValues() []Expression

func (AnalyticClause) PartitionValues added in v0.2.3

func (e AnalyticClause) PartitionValues() []Expression

func (AnalyticClause) String added in v0.2.3

func (e AnalyticClause) String() string

type AnalyticFunction added in v0.2.3

type AnalyticFunction struct {
	*BaseExpr
	Name           string
	Distinct       Token
	Args           []Expression
	IgnoreNulls    bool
	IgnoreNullsLit string
	Over           string
	AnalyticClause AnalyticClause
}

func (AnalyticFunction) IsDistinct added in v0.4.9

func (e AnalyticFunction) IsDistinct() bool

func (AnalyticFunction) String added in v0.2.3

func (e AnalyticFunction) String() string

type Any

type Any struct {
	*BaseExpr
	Any      string
	LHS      Expression
	Operator string
	Values   Expression
}

func (Any) String

func (a Any) String() string

type Arithmetic

type Arithmetic struct {
	*BaseExpr
	LHS      Expression
	Operator int
	RHS      Expression
}

func (Arithmetic) String

func (a Arithmetic) String() string

type BaseExpr added in v0.4.3

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

func NewBaseExpr added in v0.4.3

func NewBaseExpr(token Token) *BaseExpr

func (*BaseExpr) Char added in v0.4.3

func (e *BaseExpr) Char() int

func (*BaseExpr) GetBaseExpr added in v0.4.3

func (e *BaseExpr) GetBaseExpr() *BaseExpr

func (*BaseExpr) HasParseInfo added in v0.4.3

func (e *BaseExpr) HasParseInfo() bool

func (*BaseExpr) Line added in v0.4.3

func (e *BaseExpr) Line() int

func (*BaseExpr) SourceFile added in v0.4.3

func (e *BaseExpr) SourceFile() string

type Between

type Between struct {
	*BaseExpr
	Between  string
	And      string
	LHS      Expression
	Low      Expression
	High     Expression
	Negation Token
}

func (Between) IsNegated

func (b Between) IsNegated() bool

func (Between) String

func (b Between) String() string

type Boolean

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

func NewBoolean

func NewBoolean(b bool) Boolean

func (Boolean) String

func (b Boolean) String() string

func (Boolean) Ternary

func (b Boolean) Ternary() ternary.Value

func (Boolean) Value added in v0.3.1

func (b Boolean) Value() bool

type Case

type Case struct {
	*BaseExpr
	Case  string
	End   string
	Value Expression
	When  []Expression
	Else  Expression
}

func (Case) String

func (c Case) String() string

type CaseElse

type CaseElse struct {
	*BaseExpr
	Else   string
	Result Expression
}

func (CaseElse) String

func (ce CaseElse) String() string

type CaseWhen

type CaseWhen struct {
	*BaseExpr
	When      string
	Then      string
	Condition Expression
	Result    Expression
}

func (CaseWhen) String

func (cw CaseWhen) String() string

type CloseCursor added in v0.1.8

type CloseCursor struct {
	*BaseExpr
	Cursor Identifier
}

type ColumnDefault added in v0.1.6

type ColumnDefault struct {
	*BaseExpr
	Column  Identifier
	Default string
	Value   Expression
}

func (ColumnDefault) String added in v0.1.6

func (e ColumnDefault) String() string

type ColumnNumber added in v0.4.6

type ColumnNumber struct {
	*BaseExpr
	View   Identifier
	Number Integer
}

func (ColumnNumber) String added in v0.4.6

func (e ColumnNumber) String() string

type ColumnPosition added in v0.1.6

type ColumnPosition struct {
	*BaseExpr
	Position Token
	Column   Expression
}

func (ColumnPosition) String added in v0.1.6

func (e ColumnPosition) String() string

type Comparison

type Comparison struct {
	*BaseExpr
	LHS      Expression
	Operator string
	RHS      Expression
}

func (Comparison) String

func (c Comparison) String() string

type Concat

type Concat struct {
	*BaseExpr
	Items []Expression
}

func (Concat) String

func (c Concat) String() string

type CreateTable added in v0.1.6

type CreateTable struct {
	*BaseExpr
	CreateTable string
	Table       Identifier
	Fields      []Expression
}

func (CreateTable) String added in v0.1.6

func (e CreateTable) String() string

type CursorAttrebute added in v0.4.10

type CursorAttrebute struct {
	*BaseExpr
	CursorLit string
	Cursor    Identifier
	Attrebute Token
}

func (CursorAttrebute) String added in v0.4.10

func (e CursorAttrebute) String() string

type CursorDeclaration added in v0.1.8

type CursorDeclaration struct {
	*BaseExpr
	Cursor Identifier
	Query  SelectQuery
}

type CursorStatus added in v0.2.5

type CursorStatus struct {
	*BaseExpr
	CursorLit string
	Cursor    Identifier
	Is        string
	Negation  Token
	Type      int
	TypeLit   string
}

func (CursorStatus) String added in v0.2.5

func (e CursorStatus) String() string

type Datetime

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

func NewDatetime

func NewDatetime(t time.Time) Datetime

func NewDatetimeFromString

func NewDatetimeFromString(s string) Datetime

func (Datetime) Format

func (dt Datetime) Format() string

func (*Datetime) SetFormat

func (dt *Datetime) SetFormat(format string)

func (Datetime) String

func (dt Datetime) String() string

func (Datetime) Ternary

func (dt Datetime) Ternary() ternary.Value

func (Datetime) Value

func (dt Datetime) Value() time.Time

type DeleteQuery added in v0.1.6

type DeleteQuery struct {
	*BaseExpr
	WithClause  Expression
	Delete      string
	Tables      []Expression
	FromClause  Expression
	WhereClause Expression
}

func (DeleteQuery) String added in v0.1.6

func (e DeleteQuery) String() string

type DisposeCursor added in v0.1.8

type DisposeCursor struct {
	*BaseExpr
	Cursor Identifier
}

type DisposeTable added in v0.4.1

type DisposeTable struct {
	*BaseExpr
	Table Identifier
}

type DisposeVariable added in v0.4.4

type DisposeVariable struct {
	*BaseExpr
	Variable Variable
}

type DropColumns added in v0.1.6

type DropColumns struct {
	*BaseExpr
	AlterTable string
	Table      Expression
	Drop       string
	Columns    []Expression
}

func (DropColumns) String added in v0.1.6

func (e DropColumns) String() string

type Dual

type Dual struct {
	*BaseExpr
	Dual string
}

func (Dual) String

func (d Dual) String() string

type Else added in v0.1.8

type Else struct {
	*BaseExpr
	Statements []Statement
}

type ElseIf added in v0.1.8

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

type Exists

type Exists struct {
	*BaseExpr
	Exists string
	Query  Subquery
}

func (Exists) String

func (e Exists) String() string

type Expression

type Expression interface {
	String() string

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

type FetchCursor added in v0.1.8

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

type FetchPosition added in v0.2.5

type FetchPosition struct {
	*BaseExpr
	Position Token
	Number   Expression
}

func (FetchPosition) String added in v0.2.5

func (e FetchPosition) String() string

type Field

type Field struct {
	*BaseExpr
	Object Expression
	As     string
	Alias  Expression
}

func (Field) Name

func (f Field) Name() string

func (Field) String

func (f Field) String() string

type FieldReference added in v0.1.8

type FieldReference struct {
	*BaseExpr
	View   Expression
	Column Identifier
}

func (FieldReference) String added in v0.1.8

func (e FieldReference) String() string

type Float

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

func NewFloat

func NewFloat(f float64) Float

func NewFloatFromString

func NewFloatFromString(s string) Float

func (Float) String

func (f Float) String() string

func (Float) Ternary

func (f Float) Ternary() ternary.Value

func (Float) Value

func (f Float) Value() float64

type FlowControl added in v0.1.8

type FlowControl struct {
	*BaseExpr
	Token int
}

type FromClause

type FromClause struct {
	*BaseExpr
	From   string
	Tables []Expression
}

func (FromClause) String

func (f FromClause) String() string

type Function

type Function struct {
	*BaseExpr
	Name string
	Args []Expression
}

func (Function) String

func (e Function) String() string

type FunctionDeclaration added in v0.4.0

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

type GroupByClause

type GroupByClause struct {
	*BaseExpr
	GroupBy string
	Items   []Expression
}

func (GroupByClause) String

func (gb GroupByClause) String() string

type HavingClause

type HavingClause struct {
	*BaseExpr
	Having string
	Filter Expression
}

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 added in v0.1.8

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

type In

type In struct {
	*BaseExpr
	In       string
	LHS      Expression
	Values   Expression
	Negation Token
}

func (In) IsNegated

func (i In) IsNegated() bool

func (In) String

func (i In) String() string

type InlineTable added in v0.3.5

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

func (InlineTable) IsRecursive added in v0.3.5

func (e InlineTable) IsRecursive() bool

func (InlineTable) String added in v0.3.5

func (e InlineTable) String() string

type InsertQuery added in v0.1.6

type InsertQuery struct {
	*BaseExpr
	WithClause Expression
	Insert     string
	Into       string
	Table      Expression
	Fields     []Expression
	Values     string
	ValuesList []Expression
	Query      Expression
}

func (InsertQuery) String added in v0.1.6

func (e InsertQuery) String() string

type Integer

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

func NewInteger

func NewInteger(i int64) Integer

func NewIntegerFromString

func NewIntegerFromString(s string) Integer

func (Integer) String

func (i Integer) String() string

func (Integer) Ternary

func (i Integer) Ternary() ternary.Value

func (Integer) Value

func (i Integer) Value() int64

type Is

type Is struct {
	*BaseExpr
	Is       string
	LHS      Expression
	RHS      Expression
	Negation Token
}

func (Is) IsNegated

func (i Is) IsNegated() bool

func (Is) String

func (i Is) String() string

type Join

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

func (Join) String

func (j Join) String() string

type JoinCondition

type JoinCondition struct {
	*BaseExpr
	Literal string
	On      Expression
	Using   []Expression
}

func (JoinCondition) String

func (jc JoinCondition) 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
	Like     string
	LHS      Expression
	Pattern  Expression
	Negation Token
}

func (Like) IsNegated

func (l Like) IsNegated() bool

func (Like) String

func (l Like) String() string

type LimitClause

type LimitClause struct {
	*BaseExpr
	Limit   string
	Value   Expression
	Percent string
	With    Expression
}

func (LimitClause) IsPercentage added in v0.2.3

func (e LimitClause) IsPercentage() bool

func (LimitClause) IsWithTies added in v0.2.3

func (e LimitClause) IsWithTies() bool

func (LimitClause) String

func (e LimitClause) String() string

type LimitWith added in v0.2.3

type LimitWith struct {
	*BaseExpr
	With string
	Type Token
}

func (LimitWith) String added in v0.2.3

func (e LimitWith) String() string

type ListAgg added in v0.4.9

type ListAgg struct {
	*BaseExpr
	ListAgg     string
	Distinct    Token
	Args        []Expression
	WithinGroup string
	OrderBy     Expression
}

func (ListAgg) IsDistinct added in v0.4.9

func (e ListAgg) IsDistinct() bool

func (ListAgg) String added in v0.4.9

func (e ListAgg) String() string

type Logic

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

func (Logic) String

func (l Logic) String() string

type Null

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

func NewNull

func NewNull() Null

func NewNullFromString

func NewNullFromString(s string) Null

func (Null) String

func (n Null) String() string

func (Null) Ternary

func (n Null) Ternary() ternary.Value

type OffsetClause added in v0.2.2

type OffsetClause struct {
	*BaseExpr
	Offset string
	Value  Expression
}

func (OffsetClause) String added in v0.2.2

func (e OffsetClause) String() string

type OpenCursor added in v0.1.8

type OpenCursor struct {
	*BaseExpr
	Cursor Identifier
}

type OrderByClause

type OrderByClause struct {
	*BaseExpr
	OrderBy string
	Items   []Expression
}

func (OrderByClause) String

func (ob OrderByClause) String() string

type OrderItem

type OrderItem struct {
	*BaseExpr
	Value     Expression
	Direction Token
	Nulls     string
	Position  Token
}

func (OrderItem) String

func (e OrderItem) String() string

type Parentheses

type Parentheses struct {
	*BaseExpr
	Expr Expression
}

func (Parentheses) String

func (p Parentheses) String() string

type Partition added in v0.2.3

type Partition struct {
	*BaseExpr
	PartitionBy string
	Values      []Expression
}

func (Partition) String added in v0.2.3

func (e Partition) String() string

type Primary

type Primary interface {
	String() string
	Ternary() ternary.Value

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

func Float64ToPrimary

func Float64ToPrimary(f float64) Primary

func PrimaryToBoolean

func PrimaryToBoolean(p Primary) Primary

func PrimaryToDatetime

func PrimaryToDatetime(p Primary) Primary

func PrimaryToFloat

func PrimaryToFloat(p Primary) Primary

func PrimaryToInteger

func PrimaryToInteger(p Primary) Primary

func PrimaryToString

func PrimaryToString(p Primary) Primary

type Print added in v0.1.6

type Print struct {
	*BaseExpr
	Value Expression
}

type Printf added in v0.4.0

type Printf struct {
	*BaseExpr
	Format string
	Values []Expression
}

type ProcExpr added in v0.1.8

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

type RenameColumn added in v0.1.6

type RenameColumn struct {
	*BaseExpr
	AlterTable string
	Table      Expression
	Rename     string
	Old        Expression
	To         string
	New        Identifier
}

func (RenameColumn) String added in v0.1.6

func (e RenameColumn) String() string

type Return added in v0.4.0

type Return struct {
	*BaseExpr
	Value Expression
}

type RowValue added in v0.2.2

type RowValue struct {
	*BaseExpr
	Value Expression
}

func (RowValue) String added in v0.2.2

func (e RowValue) String() string

type RowValueList added in v0.2.2

type RowValueList struct {
	*BaseExpr
	RowValues []Expression
}

func (RowValueList) String added in v0.2.2

func (e RowValueList) String() string

type Scanner

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

func (*Scanner) Init

func (s *Scanner) Init(src string, sourceFile string) *Scanner

func (*Scanner) Scan

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

type SelectClause

type SelectClause struct {
	*BaseExpr
	Select   string
	Distinct Token
	Fields   []Expression
}

func (SelectClause) IsDistinct

func (sc SelectClause) IsDistinct() bool

func (SelectClause) String

func (sc SelectClause) String() string

type SelectEntity added in v0.2.1

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

func (SelectEntity) String added in v0.2.1

func (e SelectEntity) String() string

type SelectQuery

type SelectQuery struct {
	*BaseExpr
	WithClause    Expression
	SelectEntity  Expression
	OrderByClause Expression
	LimitClause   Expression
	OffsetClause  Expression
}

func (SelectQuery) String

func (e SelectQuery) String() string

type SelectSet added in v0.2.1

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

func (SelectSet) String added in v0.2.1

func (e SelectSet) String() string

type SetFlag added in v0.1.6

type SetFlag struct {
	*BaseExpr
	Name  string
	Value Primary
}

type Source added in v0.4.0

type Source struct {
	*BaseExpr
	FilePath Expression
}

type Statement

type Statement interface{}

func Parse

func Parse(s string, sourceFile string) ([]Statement, error)

type Stdin added in v0.1.5

type Stdin struct {
	*BaseExpr
	Stdin string
}

func (Stdin) String added in v0.1.5

func (si Stdin) String() string

type String

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

func NewString

func NewString(s string) String

func (String) String

func (s String) String() string

func (String) Ternary

func (s String) Ternary() ternary.Value

func (String) Value

func (s String) Value() string

type Subquery

type Subquery struct {
	*BaseExpr
	Query SelectQuery
}

func (Subquery) String

func (sq Subquery) String() string

type SyntaxError added in v0.4.3

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

func (SyntaxError) Error added in v0.4.3

func (e SyntaxError) Error() string

type Table

type Table struct {
	*BaseExpr
	Object Expression
	As     string
	Alias  Expression
}

func (Table) Name

func (t Table) Name() Identifier

func (Table) String

func (t Table) String() string

type TableDeclaration added in v0.2.9

type TableDeclaration struct {
	*BaseExpr
	Table  Identifier
	Fields []Expression
	Query  Expression
}

type Ternary

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

func NewTernary

func NewTernary(t ternary.Value) Ternary

func NewTernaryFromString

func NewTernaryFromString(s string) Ternary

func (Ternary) String

func (t Ternary) String() string

func (Ternary) Ternary

func (t Ternary) Ternary() ternary.Value

type Token

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

func (*Token) IsEmpty

func (t *Token) IsEmpty() bool

type TransactionControl added in v0.1.8

type TransactionControl struct {
	*BaseExpr
	Token int
}

type Trigger added in v0.5.0

type Trigger struct {
	*BaseExpr
	Token   int
	Message Expression
	Code    Expression
}

type UnaryArithmetic added in v0.4.3

type UnaryArithmetic struct {
	*BaseExpr
	Operand  Expression
	Operator Token
}

func (UnaryArithmetic) String added in v0.4.3

func (e UnaryArithmetic) String() string

type UnaryLogic added in v0.4.3

type UnaryLogic struct {
	*BaseExpr
	Operand  Expression
	Operator Token
}

func (UnaryLogic) String added in v0.4.3

func (e UnaryLogic) String() string

type UpdateQuery added in v0.1.6

type UpdateQuery struct {
	*BaseExpr
	WithClause  Expression
	Update      string
	Tables      []Expression
	Set         string
	SetList     []Expression
	FromClause  Expression
	WhereClause Expression
}

func (UpdateQuery) String added in v0.1.6

func (e UpdateQuery) String() string

type UpdateSet added in v0.1.6

type UpdateSet struct {
	*BaseExpr
	Field Expression
	Value Expression
}

func (UpdateSet) String added in v0.1.6

func (us UpdateSet) String() string

type ValueList added in v0.2.2

type ValueList struct {
	*BaseExpr
	Values []Expression
}

func (ValueList) String added in v0.2.2

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    Expression
}

func (VariableAssignment) String

func (va VariableAssignment) String() string

type VariableDeclaration

type VariableDeclaration struct {
	*BaseExpr
	Assignments []Expression
}

type VariableSubstitution

type VariableSubstitution struct {
	*BaseExpr
	Variable Variable
	Value    Expression
}

func (VariableSubstitution) String

func (vs VariableSubstitution) String() string

type WhereClause

type WhereClause struct {
	*BaseExpr
	Where  string
	Filter Expression
}

func (WhereClause) String

func (w WhereClause) String() string

type While added in v0.1.8

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

type WhileInCursor added in v0.1.8

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

type WithClause added in v0.3.5

type WithClause struct {
	*BaseExpr
	With         string
	InlineTables []Expression
}

func (WithClause) String added in v0.3.5

func (e WithClause) String() string

Jump to

Keyboard shortcuts

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