parser

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	KeywordAdd          = "ADD"
	KeywordAfter        = "AFTER"
	KeywordAlias        = "ALIAS"
	KeywordAll          = "ALL"
	KeywordAlter        = "ALTER"
	KeywordAnd          = "AND"
	KeywordAnti         = "ANTI"
	KeywordAny          = "ANY"
	KeywordArray        = "ARRAY"
	KeywordAs           = "AS"
	KeywordAsc          = "ASC"
	KeywordAscending    = "ASCENDING"
	KeywordAsof         = "ASOF"
	KeywordAst          = "AST"
	KeywordAsync        = "ASYNC"
	KeywordAttach       = "ATTACH"
	KeywordBetween      = "BETWEEN"
	KeywordBoth         = "BOTH"
	KeywordBy           = "BY"
	KeywordCache        = "CACHE"
	KeywordCase         = "CASE"
	KeywordCast         = "CAST"
	KeywordCheck        = "CHECK"
	KeywordClear        = "CLEAR"
	KeywordCluster      = "CLUSTER"
	KeywordCodec        = "CODEC"
	KeywordCollate      = "COLLATE"
	KeywordColumn       = "COLUMN"
	KeywordComment      = "COMMENT"
	KeywordCompiled     = "COMPILED"
	KeywordConstraint   = "CONSTRAINT"
	KeywordCreate       = "CREATE"
	KeywordCross        = "CROSS"
	KeywordCube         = "CUBE"
	KeywordCurrent      = "CURRENT"
	KeywordDatabase     = "DATABASE"
	KeywordDatabases    = "DATABASES"
	KeywordDate         = "DATE"
	KeywordDay          = "DAY"
	KeywordDeduplicate  = "DEDUPLICATE"
	KeywordDefault      = "DEFAULT"
	KeywordDelay        = "DELAY"
	KeywordDelete       = "DELETE"
	KeywordDesc         = "DESC"
	KeywordDescending   = "DESCENDING"
	KeywordDescribe     = "DESCRIBE"
	KeywordDetach       = "DETACH"
	KeywordDetached     = "DETACHED"
	KeywordDictionaries = "DICTIONARIES"
	KeywordDictionary   = "DICTIONARY"
	KeywordDisk         = "DISK"
	KeywordDistinct     = "DISTINCT"
	KeywordDistributed  = "DISTRIBUTED"
	KeywordDrop         = "DROP"
	KeywordDNS          = "DNS"
	KeywordElse         = "ELSE"
	KeywordEnd          = "END"
	KeywordEngine       = "ENGINE"
	KeywordEvents       = "EVENTS"
	KeywordExcept       = "EXCEPT"
	KeywordExists       = "EXISTS"
	KeywordExplain      = "EXPLAIN"
	KeywordExpression   = "EXPRESSION"
	KeywordExtract      = "EXTRACT"
	KeywordFetches      = "FETCHES"
	KeywordFileSystem   = "FILESYSTEM"
	KeywordFinal        = "FINAL"
	KeywordFirst        = "FIRST"
	KeywordFlush        = "FLUSH"
	KeywordFollowing    = "FOLLOWING"
	KeywordFor          = "FOR"
	KeywordFormat       = "FORMAT"
	KeywordFreeze       = "FREEZE"
	KeywordFrom         = "FROM"
	KeywordFull         = "FULL"
	KeywordFunction     = "FUNCTION"
	KeywordGlobal       = "GLOBAL"
	KeywordGranularity  = "GRANULARITY"
	KeywordGroup        = "GROUP"
	KeywordHaving       = "HAVING"
	KeywordHierarchical = "HIERARCHICAL"
	KeywordHour         = "HOUR"
	KeywordId           = "ID"
	KeywordIf           = "IF"
	KeywordIlike        = "ILIKE"
	KeywordIn           = "IN"
	KeywordIndex        = "INDEX"
	KeywordInf          = "INF"
	KeywordInjective    = "INJECTIVE"
	KeywordInner        = "INNER"
	KeywordInsert       = "INSERT"
	KeywordInterval     = "INTERVAL"
	KeywordInto         = "INTO"
	KeywordIs           = "IS"
	KeywordIs_object_id = "IS_OBJECT_ID"
	KeywordJoin         = "JOIN"
	KeywordKey          = "KEY"
	KeywordKill         = "KILL"
	KeywordLast         = "LAST"
	KeywordLayout       = "LAYOUT"
	KeywordLeading      = "LEADING"
	KeywordLeft         = "LEFT"
	KeywordLifetime     = "LIFETIME"
	KeywordLike         = "LIKE"
	KeywordLimit        = "LIMIT"
	KeywordLive         = "LIVE"
	KeywordLocal        = "LOCAL"
	KeywordLogs         = "LOGS"
	KeywordMark         = "MARK"
	KeywordMaterialize  = "MATERIALIZE"
	KeywordMaterialized = "MATERIALIZED"
	KeywordMax          = "MAX"
	KeywordMerges       = "MERGES"
	KeywordMin          = "MIN"
	KeywordMinute       = "MINUTE"
	KeywordModify       = "MODIFY"
	KeywordMonth        = "MONTH"
	KeywordMove         = "MOVE"
	KeywordMutation     = "MUTATION"
	KeywordNan_sql      = "NAN_SQL"
	KeywordNo           = "NO"
	KeywordNot          = "NOT"
	KeywordNull         = "NULL"
	KeywordNulls        = "NULLS"
	KeywordOffset       = "OFFSET"
	KeywordOn           = "ON"
	KeywordOptimize     = "OPTIMIZE"
	KeywordOr           = "OR"
	KeywordOrder        = "ORDER"
	KeywordOuter        = "OUTER"
	KeywordOutfile      = "OUTFILE"
	KeywordOver         = "OVER"
	KeywordPartition    = "PARTITION"
	KeywordPopulate     = "POPULATE"
	KeywordPreceding    = "PRECEDING"
	KeywordPrewhere     = "PREWHERE"
	KeywordPrimary      = "PRIMARY"
	KeywordProjection   = "PROJECTION"
	KeywordQuarter      = "QUARTER"
	KeywordQuery        = "QUERY"
	KeywordRange        = "RANGE"
	KeywordReload       = "RELOAD"
	KeywordRemove       = "REMOVE"
	KeywordRename       = "RENAME"
	KeywordReplace      = "REPLACE"
	KeywordReplica      = "REPLICA"
	KeywordReplicated   = "REPLICATED"
	KeywordRight        = "RIGHT"
	KeywordRollup       = "ROLLUP"
	KeywordRow          = "ROW"
	KeywordRows         = "ROWS"
	KeywordSample       = "SAMPLE"
	KeywordSecond       = "SECOND"
	KeywordSelect       = "SELECT"
	KeywordSemi         = "SEMI"
	KeywordSends        = "SENDS"
	KeywordSet          = "SET"
	KeywordSettings     = "SETTINGS"
	KeywordShow         = "SHOW"
	KeywordSource       = "SOURCE"
	KeywordStart        = "START"
	KeywordStop         = "STOP"
	KeywordSubstring    = "SUBSTRING"
	KeywordSync         = "SYNC"
	KeywordSyntax       = "SYNTAX"
	KeywordSystem       = "SYSTEM"
	KeywordTable        = "TABLE"
	KeywordTables       = "TABLES"
	KeywordTemporary    = "TEMPORARY"
	KeywordTest         = "TEST"
	KeywordThen         = "THEN"
	KeywordTies         = "TIES"
	KeywordTimeout      = "TIMEOUT"
	KeywordTimestamp    = "TIMESTAMP"
	KeywordTo           = "TO"
	KeywordTop          = "TOP"
	KeywordTotals       = "TOTALS"
	KeywordTrailing     = "TRAILING"
	KeywordTrim         = "TRIM"
	KeywordTruncate     = "TRUNCATE"
	KeywordTtl          = "TTL"
	KeywordType         = "TYPE"
	KeywordUnbounded    = "UNBOUNDED"
	KeywordUncompressed = "UNCOMPRESSED"
	KeywordUnion        = "UNION"
	KeywordUpdate       = "UPDATE"
	KeywordUse          = "USE"
	KeywordUsing        = "USING"
	KeywordUuid         = "UUID"
	KeywordValues       = "VALUES"
	KeywordView         = "VIEW"
	KeywordVolume       = "VOLUME"
	KeywordWatch        = "WATCH"
	KeywordWeek         = "WEEK"
	KeywordWhen         = "WHEN"
	KeywordWhere        = "WHERE"
	KeywordWindow       = "WINDOW"
	KeywordWith         = "WITH"
	KeywordYear         = "YEAR"
)

Variables

This section is empty.

Functions

func IsDigit

func IsDigit(c byte) bool

func IsHexDigit

func IsHexDigit(c byte) bool

func IsIdentPart

func IsIdentPart(c byte) bool

func IsIdentStart

func IsIdentStart(c byte) bool

func NewLine

func NewLine(level int) string

func TabSpaces

func TabSpaces(level int) string

Types

type AliasExpr

type AliasExpr struct {
	Expr     Expr
	AliasPos Pos
	Alias    *Ident
}

func (*AliasExpr) End

func (a *AliasExpr) End() Pos

func (*AliasExpr) Pos

func (a *AliasExpr) Pos() Pos

func (*AliasExpr) String

func (a *AliasExpr) String(level int) string

type AlterTable

type AlterTable struct {
	AlterPos        Pos
	StatementEnd    Pos
	TableIdentifier *TableIdentifier
	OnCluster       *OnClusterExpr
	AlterExprs      []AlterTableExpr
}

func (*AlterTable) End

func (a *AlterTable) End() Pos

func (*AlterTable) Pos

func (a *AlterTable) Pos() Pos

func (*AlterTable) String

func (a *AlterTable) String(level int) string

func (*AlterTable) Type

func (a *AlterTable) Type() string

type AlterTableAddColumn

type AlterTableAddColumn struct {
	AddPos       Pos
	StatementEnd Pos

	Column      *Column
	IfNotExists bool
	After       *NestedIdentifier
}

func (*AlterTableAddColumn) AlterType

func (a *AlterTableAddColumn) AlterType() string

func (*AlterTableAddColumn) End

func (a *AlterTableAddColumn) End() Pos

func (*AlterTableAddColumn) Pos

func (a *AlterTableAddColumn) Pos() Pos

func (*AlterTableAddColumn) String

func (a *AlterTableAddColumn) String(level int) string

type AlterTableAddIndex

type AlterTableAddIndex struct {
	AddPos       Pos
	StatementEnd Pos

	Index       *TableIndex
	IfNotExists bool
	After       *NestedIdentifier
}

func (*AlterTableAddIndex) AlterType

func (a *AlterTableAddIndex) AlterType() string

func (*AlterTableAddIndex) End

func (a *AlterTableAddIndex) End() Pos

func (*AlterTableAddIndex) Pos

func (a *AlterTableAddIndex) Pos() Pos

func (*AlterTableAddIndex) String

func (a *AlterTableAddIndex) String(level int) string

type AlterTableAttachPartition

type AlterTableAttachPartition struct {
	AttachPos Pos

	Partition *PartitionExpr
	From      *TableIdentifier
}

func (*AlterTableAttachPartition) AlterType

func (a *AlterTableAttachPartition) AlterType() string

func (*AlterTableAttachPartition) End

func (a *AlterTableAttachPartition) End() Pos

func (*AlterTableAttachPartition) Pos

func (a *AlterTableAttachPartition) Pos() Pos

func (*AlterTableAttachPartition) String

func (a *AlterTableAttachPartition) String(level int) string

type AlterTableClearColumn

type AlterTableClearColumn struct {
	ClearPos     Pos
	StatementEnd Pos

	IfExists      bool
	ColumnName    *NestedIdentifier
	PartitionExpr *PartitionExpr
}

func (*AlterTableClearColumn) AlterType

func (a *AlterTableClearColumn) AlterType() string

func (*AlterTableClearColumn) End

func (a *AlterTableClearColumn) End() Pos

func (*AlterTableClearColumn) Pos

func (a *AlterTableClearColumn) Pos() Pos

func (*AlterTableClearColumn) String

func (a *AlterTableClearColumn) String(level int) string

type AlterTableClearIndex

type AlterTableClearIndex struct {
	ClearPos     Pos
	StatementEnd Pos

	IfExists      bool
	IndexName     *NestedIdentifier
	PartitionExpr *PartitionExpr
}

func (*AlterTableClearIndex) AlterType

func (a *AlterTableClearIndex) AlterType() string

func (*AlterTableClearIndex) End

func (a *AlterTableClearIndex) End() Pos

func (*AlterTableClearIndex) Pos

func (a *AlterTableClearIndex) Pos() Pos

func (*AlterTableClearIndex) String

func (a *AlterTableClearIndex) String(level int) string

type AlterTableDetachPartition

type AlterTableDetachPartition struct {
	DetachPos Pos
	Partition *PartitionExpr
	Settings  *SettingsExprList
}

func (*AlterTableDetachPartition) AlterType

func (a *AlterTableDetachPartition) AlterType() string

func (*AlterTableDetachPartition) End

func (a *AlterTableDetachPartition) End() Pos

func (*AlterTableDetachPartition) Pos

func (a *AlterTableDetachPartition) Pos() Pos

func (*AlterTableDetachPartition) String

func (a *AlterTableDetachPartition) String(level int) string

type AlterTableDropColumn

type AlterTableDropColumn struct {
	DropPos    Pos
	ColumnName *NestedIdentifier
	IfExists   bool
}

func (*AlterTableDropColumn) AlterType

func (a *AlterTableDropColumn) AlterType() string

func (*AlterTableDropColumn) End

func (a *AlterTableDropColumn) End() Pos

func (*AlterTableDropColumn) Pos

func (a *AlterTableDropColumn) Pos() Pos

func (*AlterTableDropColumn) String

func (a *AlterTableDropColumn) String(level int) string

type AlterTableDropIndex

type AlterTableDropIndex struct {
	DropPos   Pos
	IndexName *NestedIdentifier
	IfExists  bool
}

func (*AlterTableDropIndex) AlterType

func (a *AlterTableDropIndex) AlterType() string

func (*AlterTableDropIndex) End

func (a *AlterTableDropIndex) End() Pos

func (*AlterTableDropIndex) Pos

func (a *AlterTableDropIndex) Pos() Pos

func (*AlterTableDropIndex) String

func (a *AlterTableDropIndex) String(level int) string

type AlterTableDropPartition

type AlterTableDropPartition struct {
	DropPos   Pos
	Partition *PartitionExpr
}

func (*AlterTableDropPartition) AlterType

func (a *AlterTableDropPartition) AlterType() string

func (*AlterTableDropPartition) End

func (a *AlterTableDropPartition) End() Pos

func (*AlterTableDropPartition) Pos

func (a *AlterTableDropPartition) Pos() Pos

func (*AlterTableDropPartition) String

func (a *AlterTableDropPartition) String(level int) string

type AlterTableExpr

type AlterTableExpr interface {
	Expr
	AlterType() string
}

type AlterTableFreezePartition

type AlterTableFreezePartition struct {
	FreezePos    Pos
	StatementEnd Pos
	Partition    *PartitionExpr
}

func (*AlterTableFreezePartition) AlterType

func (a *AlterTableFreezePartition) AlterType() string

func (*AlterTableFreezePartition) End

func (a *AlterTableFreezePartition) End() Pos

func (*AlterTableFreezePartition) Pos

func (a *AlterTableFreezePartition) Pos() Pos

func (*AlterTableFreezePartition) String

func (a *AlterTableFreezePartition) String(level int) string

type AlterTableModifyColumn

type AlterTableModifyColumn struct {
	ModifyPos    Pos
	StatementEnd Pos

	IfExists           bool
	Column             *Column
	RemovePropertyType *RemovePropertyType
}

func (*AlterTableModifyColumn) AlterType

func (a *AlterTableModifyColumn) AlterType() string

func (*AlterTableModifyColumn) End

func (a *AlterTableModifyColumn) End() Pos

func (*AlterTableModifyColumn) Pos

func (a *AlterTableModifyColumn) Pos() Pos

func (*AlterTableModifyColumn) String

func (a *AlterTableModifyColumn) String(level int) string

type AlterTableRemoveTTL

type AlterTableRemoveTTL struct {
	RemovePos    Pos
	StatementEnd Pos
}

func (*AlterTableRemoveTTL) AlterType

func (a *AlterTableRemoveTTL) AlterType() string

func (*AlterTableRemoveTTL) End

func (a *AlterTableRemoveTTL) End() Pos

func (*AlterTableRemoveTTL) Pos

func (a *AlterTableRemoveTTL) Pos() Pos

func (*AlterTableRemoveTTL) String

func (a *AlterTableRemoveTTL) String(level int) string

type AlterTableRenameColumn

type AlterTableRenameColumn struct {
	RenamePos Pos

	IfExists      bool
	OldColumnName *NestedIdentifier
	NewColumnName *NestedIdentifier
}

func (*AlterTableRenameColumn) AlterType

func (a *AlterTableRenameColumn) AlterType() string

func (*AlterTableRenameColumn) End

func (a *AlterTableRenameColumn) End() Pos

func (*AlterTableRenameColumn) Pos

func (a *AlterTableRenameColumn) Pos() Pos

func (*AlterTableRenameColumn) String

func (a *AlterTableRenameColumn) String(level int) string

type AlterTableReplacePartition added in v0.3.0

type AlterTableReplacePartition struct {
	ReplacePos Pos
	Partition  *PartitionExpr
	Table      *TableIdentifier
}

func (*AlterTableReplacePartition) AlterType added in v0.3.0

func (a *AlterTableReplacePartition) AlterType() string

func (*AlterTableReplacePartition) End added in v0.3.0

func (*AlterTableReplacePartition) Pos added in v0.3.0

func (*AlterTableReplacePartition) String added in v0.3.0

func (a *AlterTableReplacePartition) String(level int) string

type ArrayJoinExpr

type ArrayJoinExpr struct {
	ArrayPos Pos
	Type     string
	Expr     Expr
}

func (*ArrayJoinExpr) End

func (a *ArrayJoinExpr) End() Pos

func (*ArrayJoinExpr) Pos

func (a *ArrayJoinExpr) Pos() Pos

func (*ArrayJoinExpr) String

func (a *ArrayJoinExpr) String(level int) string

type ArrayParamList

type ArrayParamList struct {
	LeftBracketPos  Pos
	RightBracketPos Pos
	Items           *ColumnExprList
}

func (*ArrayParamList) End

func (a *ArrayParamList) End() Pos

func (*ArrayParamList) Pos

func (a *ArrayParamList) Pos() Pos

func (*ArrayParamList) String

func (a *ArrayParamList) String(level int) string

type BinaryExpr

type BinaryExpr struct {
	LeftExpr  Expr
	Operation TokenKind
	RightExpr Expr
	HasGlobal bool
	HasNot    bool
}

func (*BinaryExpr) End

func (p *BinaryExpr) End() Pos

func (*BinaryExpr) Pos

func (p *BinaryExpr) Pos() Pos

func (*BinaryExpr) String

func (p *BinaryExpr) String(level int) string

type CTEExpr

type CTEExpr struct {
	CTEPos Pos
	Expr   Expr
	Alias  Expr
}

func (*CTEExpr) End

func (c *CTEExpr) End() Pos

func (*CTEExpr) Pos

func (c *CTEExpr) Pos() Pos

func (*CTEExpr) String

func (c *CTEExpr) String(level int) string

type CaseExpr

type CaseExpr struct {
	CasePos Pos
	EndPos  Pos
	Expr    Expr
	Whens   []*WhenExpr
	ElsePos Pos
	Else    Expr
}

func (*CaseExpr) End

func (c *CaseExpr) End() Pos

func (*CaseExpr) Pos

func (c *CaseExpr) Pos() Pos

func (*CaseExpr) String

func (c *CaseExpr) String(level int) string

type CastExpr

type CastExpr struct {
	CastPos Pos
	Expr    Expr
	AsPos   Pos
	AsType  Expr
}

func (*CastExpr) End

func (c *CastExpr) End() Pos

func (*CastExpr) Pos

func (c *CastExpr) Pos() Pos

func (*CastExpr) String

func (c *CastExpr) String(level int) string

type CheckExpr added in v0.3.0

type CheckExpr struct {
	CheckPos  Pos
	Table     *TableIdentifier
	Partition *PartitionExpr
}

func (*CheckExpr) End added in v0.3.0

func (c *CheckExpr) End() Pos

func (*CheckExpr) Pos added in v0.3.0

func (c *CheckExpr) Pos() Pos

func (*CheckExpr) String added in v0.3.0

func (c *CheckExpr) String(level int) string

type Column

type Column struct {
	NamePos   Pos
	ColumnEnd Pos
	Name      *Ident
	Type      Expr
	NotNull   *NotNullLiteral
	Nullable  *NullLiteral

	Property Expr

	Codec *CompressionCodec
	TTL   Expr

	Comment          *StringLiteral
	CompressionCodec *Ident
}

func (*Column) End

func (c *Column) End() Pos

func (*Column) Pos

func (c *Column) Pos() Pos

func (*Column) String

func (c *Column) String(level int) string

type ColumnArgList

type ColumnArgList struct {
	Distinct      bool
	LeftParenPos  Pos
	RightParenPos Pos
	Items         []Expr
}

func (*ColumnArgList) End

func (c *ColumnArgList) End() Pos

func (*ColumnArgList) Pos

func (c *ColumnArgList) Pos() Pos

func (*ColumnArgList) String

func (c *ColumnArgList) String(level int) string

type ColumnExprList

type ColumnExprList struct {
	ListPos Pos
	ListEnd Pos
	Items   []Expr
}

func (*ColumnExprList) End

func (c *ColumnExprList) End() Pos

func (*ColumnExprList) Pos

func (c *ColumnExprList) Pos() Pos

func (*ColumnExprList) String

func (c *ColumnExprList) String(level int) string

type ColumnNamesExpr added in v0.3.0

type ColumnNamesExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	ColumnNames   []NestedIdentifier
}

func (*ColumnNamesExpr) End added in v0.3.0

func (c *ColumnNamesExpr) End() Pos

func (*ColumnNamesExpr) Pos added in v0.3.0

func (c *ColumnNamesExpr) Pos() Pos

func (*ColumnNamesExpr) String added in v0.3.0

func (c *ColumnNamesExpr) String(level int) string

type ColumnTypeExpr

type ColumnTypeExpr struct {
	Name *Ident
}

func (*ColumnTypeExpr) End

func (c *ColumnTypeExpr) End() Pos

func (*ColumnTypeExpr) Pos

func (c *ColumnTypeExpr) Pos() Pos

func (*ColumnTypeExpr) String

func (c *ColumnTypeExpr) String(level int) string

type ComplexTypeExpr

type ComplexTypeExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	Name          *Ident
	Params        []Expr
}

func (*ComplexTypeExpr) End

func (c *ComplexTypeExpr) End() Pos

func (*ComplexTypeExpr) Pos

func (c *ComplexTypeExpr) Pos() Pos

func (*ComplexTypeExpr) String

func (c *ComplexTypeExpr) String(level int) string

type CompressionCodec

type CompressionCodec struct {
	CodecPos      Pos
	RightParenPos Pos
	Name          *Ident
	Level         *NumberLiteral // compression level
}

func (*CompressionCodec) End

func (c *CompressionCodec) End() Pos

func (*CompressionCodec) Pos

func (c *CompressionCodec) Pos() Pos

func (*CompressionCodec) String

func (c *CompressionCodec) String(level int) string

type ConstraintExpr

type ConstraintExpr struct {
	ConstraintPos Pos
	Constraint    *Ident
	Expr          Expr
}

func (*ConstraintExpr) End

func (c *ConstraintExpr) End() Pos

func (*ConstraintExpr) Pos

func (c *ConstraintExpr) Pos() Pos

func (*ConstraintExpr) String

func (c *ConstraintExpr) String(level int) string

type CreateDatabase

type CreateDatabase struct {
	CreatePos    Pos // position of CREATE keyword
	StatementEnd Pos
	Name         *Ident
	IfNotExists  bool // true if 'IF NOT EXISTS' is specified
	OnCluster    *OnClusterExpr
	Engine       *EngineExpr
}

func (*CreateDatabase) End

func (c *CreateDatabase) End() Pos

func (*CreateDatabase) Pos

func (c *CreateDatabase) Pos() Pos

func (*CreateDatabase) String

func (c *CreateDatabase) String(level int) string

func (*CreateDatabase) Type

func (c *CreateDatabase) Type() string

type CreateLiveView

type CreateLiveView struct {
	CreatePos    Pos
	StatementEnd Pos
	Name         *TableIdentifier
	IfNotExists  bool
	UUID         *UUID
	OnCluster    *OnClusterExpr
	Destination  *DestinationExpr
	TableSchema  *TableSchemaExpr
	WithTimeout  *WithTimeoutExpr
	SubQuery     *SubQueryExpr
}

func (*CreateLiveView) End

func (c *CreateLiveView) End() Pos

func (*CreateLiveView) Pos

func (c *CreateLiveView) Pos() Pos

func (*CreateLiveView) String

func (c *CreateLiveView) String(level int) string

func (*CreateLiveView) Type

func (c *CreateLiveView) Type() string

type CreateMaterializedView

type CreateMaterializedView struct {
	CreatePos    Pos // position of CREATE|ATTACH keyword
	StatementEnd Pos
	Name         *TableIdentifier
	IfNotExists  bool
	UUID         *UUID
	OnCluster    *OnClusterExpr
	TableSchema  *TableSchemaExpr
	Engine       *EngineExpr
	Destination  *DestinationExpr
	SubQuery     *SubQueryExpr
	Populate     bool
}

func (*CreateMaterializedView) End

func (c *CreateMaterializedView) End() Pos

func (*CreateMaterializedView) Pos

func (c *CreateMaterializedView) Pos() Pos

func (*CreateMaterializedView) String

func (c *CreateMaterializedView) String(level int) string

func (*CreateMaterializedView) Type

func (c *CreateMaterializedView) Type() string

type CreateTable

type CreateTable struct {
	CreatePos    Pos // position of CREATE|ATTACH keyword
	StatementEnd Pos
	Name         *TableIdentifier
	IfNotExists  bool
	UUID         *UUID
	OnCluster    *OnClusterExpr
	TableSchema  *TableSchemaExpr
	Engine       *EngineExpr
	SubQuery     *SubQueryExpr
}

func (*CreateTable) End

func (c *CreateTable) End() Pos

func (*CreateTable) Pos

func (c *CreateTable) Pos() Pos

func (*CreateTable) String

func (c *CreateTable) String(level int) string

func (*CreateTable) Type

func (c *CreateTable) Type() string

type CreateView

type CreateView struct {
	CreatePos    Pos // position of CREATE|ATTACH keyword
	StatementEnd Pos
	Name         *TableIdentifier
	IfNotExists  bool
	UUID         *UUID
	OnCluster    *OnClusterExpr
	TableSchema  *TableSchemaExpr
	SubQuery     *SubQueryExpr
}

func (*CreateView) End

func (c *CreateView) End() Pos

func (*CreateView) Pos

func (c *CreateView) Pos() Pos

func (*CreateView) String

func (c *CreateView) String(level int) string

func (*CreateView) Type

func (c *CreateView) Type() string

type DDL

type DDL interface {
	Expr
	Type() string
}

type DeduplicateExpr added in v0.3.0

type DeduplicateExpr struct {
	DeduplicatePos Pos
	By             *ColumnExprList
	Except         *ColumnExprList
}

func (*DeduplicateExpr) End added in v0.3.0

func (d *DeduplicateExpr) End() Pos

func (*DeduplicateExpr) Pos added in v0.3.0

func (d *DeduplicateExpr) Pos() Pos

func (*DeduplicateExpr) String added in v0.3.0

func (d *DeduplicateExpr) String(level int) string

type DefaultExpr

type DefaultExpr struct {
	DefaultPos Pos
	Expr       Expr
}

func (*DefaultExpr) End

func (d *DefaultExpr) End() Pos

func (*DefaultExpr) Pos

func (d *DefaultExpr) Pos() Pos

func (*DefaultExpr) String

func (d *DefaultExpr) String(level int) string

type DeleteFromExpr added in v0.3.0

type DeleteFromExpr struct {
	DeletePos Pos
	Table     *TableIdentifier
	OnCluster *OnClusterExpr
	WhereExpr Expr
}

func (*DeleteFromExpr) End added in v0.3.0

func (d *DeleteFromExpr) End() Pos

func (*DeleteFromExpr) Pos added in v0.3.0

func (d *DeleteFromExpr) Pos() Pos

func (*DeleteFromExpr) String added in v0.3.0

func (d *DeleteFromExpr) String(level int) string

type DestinationExpr

type DestinationExpr struct {
	ToPos           Pos
	TableIdentifier *TableIdentifier
}

func (*DestinationExpr) End

func (d *DestinationExpr) End() Pos

func (*DestinationExpr) Pos

func (d *DestinationExpr) Pos() Pos

func (*DestinationExpr) String

func (d *DestinationExpr) String(level int) string

type DropDatabase

type DropDatabase struct {
	DropPos      Pos
	StatementEnd Pos
	Name         *Ident
	IfExists     bool
	OnCluster    *OnClusterExpr
}

func (*DropDatabase) End

func (d *DropDatabase) End() Pos

func (*DropDatabase) Pos

func (d *DropDatabase) Pos() Pos

func (*DropDatabase) String

func (d *DropDatabase) String(level int) string

func (*DropDatabase) Type

func (d *DropDatabase) Type() string

type DropTable

type DropTable struct {
	DropPos      Pos
	StatementEnd Pos
	Name         *TableIdentifier
	IfExists     bool
	OnCluster    *OnClusterExpr
	IsTemporary  bool
	NoDelay      bool
}

func (*DropTable) End

func (d *DropTable) End() Pos

func (*DropTable) Pos

func (d *DropTable) Pos() Pos

func (*DropTable) String

func (d *DropTable) String(level int) string

func (*DropTable) Type

func (d *DropTable) Type() string

type EngineExpr

type EngineExpr struct {
	EnginePos        Pos
	EngineEnd        Pos
	Name             string
	Params           *ParamExprList
	PrimaryKey       *PrimaryKeyExpr
	PartitionBy      *PartitionByExpr
	SampleBy         *SampleByExpr
	TTLExprList      *TTLExprList
	SettingsExprList *SettingsExprList
	OrderByListExpr  *OrderByListExpr
}

func (*EngineExpr) End

func (e *EngineExpr) End() Pos

func (*EngineExpr) Pos

func (e *EngineExpr) Pos() Pos

func (*EngineExpr) String

func (e *EngineExpr) String(level int) string

type EnumValueExpr

type EnumValueExpr struct {
	Name  *StringLiteral
	Value *NumberLiteral
}

func (*EnumValueExpr) End

func (e *EnumValueExpr) End() Pos

func (*EnumValueExpr) Pos

func (e *EnumValueExpr) Pos() Pos

func (*EnumValueExpr) String

func (e *EnumValueExpr) String(level int) string

type EnumValueExprList

type EnumValueExprList struct {
	ListPos Pos
	ListEnd Pos
	Enums   []EnumValueExpr
}

func (*EnumValueExprList) End

func (e *EnumValueExprList) End() Pos

func (*EnumValueExprList) Pos

func (e *EnumValueExprList) Pos() Pos

func (*EnumValueExprList) String

func (e *EnumValueExprList) String(level int) string

type Expr

type Expr interface {
	Pos() Pos
	End() Pos
	String(level int) string
}

type ExtractExpr

type ExtractExpr struct {
	ExtractPos Pos
	Interval   *Ident
	FromPos    Pos
	FromExpr   Expr
}

func (*ExtractExpr) End

func (e *ExtractExpr) End() Pos

func (*ExtractExpr) Pos

func (e *ExtractExpr) Pos() Pos

func (*ExtractExpr) String

func (e *ExtractExpr) String(level int) string

type FloatLiteral

type FloatLiteral struct {
	FloatPos Pos
	FloatEnd Pos
	Literal  string
}

func (*FloatLiteral) End

func (f *FloatLiteral) End() Pos

func (*FloatLiteral) Pos

func (f *FloatLiteral) Pos() Pos

func (*FloatLiteral) String

func (f *FloatLiteral) String(int) string

type FormatExpr

type FormatExpr struct {
	FormatPos Pos
	Format    *Ident
}

func (*FormatExpr) End

func (f *FormatExpr) End() Pos

func (*FormatExpr) Pos

func (f *FormatExpr) Pos() Pos

func (*FormatExpr) String

func (f *FormatExpr) String(level int) string

type FromExpr

type FromExpr struct {
	FromPos Pos
	Expr    Expr
}

func (*FromExpr) End

func (f *FromExpr) End() Pos

func (*FromExpr) Pos

func (f *FromExpr) Pos() Pos

func (*FromExpr) String

func (f *FromExpr) String(level int) string

type FunctionExpr

type FunctionExpr struct {
	Name   *Ident
	Params *ParamExprList
}

func (*FunctionExpr) End

func (f *FunctionExpr) End() Pos

func (*FunctionExpr) Pos

func (f *FunctionExpr) Pos() Pos

func (*FunctionExpr) String

func (f *FunctionExpr) String(level int) string

type GlobalInExpr

type GlobalInExpr struct {
	GlobalPos Pos
	Expr      Expr
}

func (*GlobalInExpr) End

func (g *GlobalInExpr) End() Pos

func (*GlobalInExpr) Pos

func (g *GlobalInExpr) Pos() Pos

func (*GlobalInExpr) String

func (g *GlobalInExpr) String(level int) string

type GroupByExpr

type GroupByExpr struct {
	GroupByPos    Pos
	AggregateType string
	Expr          Expr
	WithCube      bool
	WithRollup    bool
	WithTotals    bool
}

func (*GroupByExpr) End

func (g *GroupByExpr) End() Pos

func (*GroupByExpr) Pos

func (g *GroupByExpr) Pos() Pos

func (*GroupByExpr) String

func (g *GroupByExpr) String(level int) string

type HavingExpr

type HavingExpr struct {
	HavingPos Pos
	Expr      Expr
}

func (*HavingExpr) End

func (h *HavingExpr) End() Pos

func (*HavingExpr) Pos

func (h *HavingExpr) Pos() Pos

func (*HavingExpr) String

func (h *HavingExpr) String(level int) string

type Ident

type Ident struct {
	Name     string
	Unquoted bool
	NamePos  Pos
	NameEnd  Pos
}

func (*Ident) End

func (i *Ident) End() Pos

func (*Ident) Pos

func (i *Ident) Pos() Pos

func (*Ident) String

func (i *Ident) String(int) string

type InsertExpr added in v0.3.0

type InsertExpr struct {
	InsertPos   Pos
	Format      *FormatExpr
	Table       Expr
	ColumnNames *ColumnNamesExpr
	Values      []*ValuesExpr
	SelectExpr  *SelectQuery
}

func (*InsertExpr) End added in v0.3.0

func (i *InsertExpr) End() Pos

func (*InsertExpr) Pos added in v0.3.0

func (i *InsertExpr) Pos() Pos

func (*InsertExpr) String added in v0.3.0

func (i *InsertExpr) String(level int) string

type IntervalExpr

type IntervalExpr struct {
	IntervalPos Pos
	Expr        Expr
	Unit        *Ident
}

func (*IntervalExpr) End

func (i *IntervalExpr) End() Pos

func (*IntervalExpr) Pos

func (i *IntervalExpr) Pos() Pos

func (*IntervalExpr) String

func (i *IntervalExpr) String(level int) string

type IsNotNullExpr

type IsNotNullExpr struct {
	IsPos Pos
	Expr  Expr
}

func (*IsNotNullExpr) End

func (n *IsNotNullExpr) End() Pos

func (*IsNotNullExpr) Pos

func (n *IsNotNullExpr) Pos() Pos

func (*IsNotNullExpr) String

func (n *IsNotNullExpr) String(level int) string

type IsNullExpr

type IsNullExpr struct {
	IsPos Pos
	Expr  Expr
}

func (*IsNullExpr) End

func (n *IsNullExpr) End() Pos

func (*IsNullExpr) Pos

func (n *IsNullExpr) Pos() Pos

func (*IsNullExpr) String

func (n *IsNullExpr) String(level int) string

type JoinConstraintExpr

type JoinConstraintExpr struct {
	ConstraintPos Pos
	On            *ColumnExprList
	Using         *ColumnExprList
}

func (*JoinConstraintExpr) End

func (j *JoinConstraintExpr) End() Pos

func (*JoinConstraintExpr) Pos

func (j *JoinConstraintExpr) Pos() Pos

func (*JoinConstraintExpr) String

func (j *JoinConstraintExpr) String(level int) string

type JoinExpr

type JoinExpr struct {
	JoinPos     Pos
	Left        Expr
	Right       Expr
	JoinType    string
	SampleRatio *SampleRatioExpr
	Constraints Expr
}

func (*JoinExpr) End

func (j *JoinExpr) End() Pos

func (*JoinExpr) Pos

func (j *JoinExpr) Pos() Pos

func (*JoinExpr) String

func (j *JoinExpr) String(level int) string

type Lexer

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

func NewLexer

func NewLexer(buf string) *Lexer

type LimitByExpr

type LimitByExpr struct {
	LimitPos Pos
	Limit    Expr
	Offset   Expr
	ByExpr   *ColumnExprList
}

func (*LimitByExpr) End

func (l *LimitByExpr) End() Pos

func (*LimitByExpr) Pos

func (l *LimitByExpr) Pos() Pos

func (*LimitByExpr) String

func (l *LimitByExpr) String(level int) string

type Literal

type Literal interface {
	Expr
}

type NegateExpr

type NegateExpr struct {
	NegatePos Pos
	Expr      Expr
}

func (*NegateExpr) End

func (n *NegateExpr) End() Pos

func (*NegateExpr) Pos

func (n *NegateExpr) Pos() Pos

func (*NegateExpr) String

func (n *NegateExpr) String(level int) string

type NestedIdentifier

type NestedIdentifier struct {
	Ident    *Ident
	DotIdent *Ident
}

func (*NestedIdentifier) End

func (n *NestedIdentifier) End() Pos

func (*NestedIdentifier) Pos

func (n *NestedIdentifier) Pos() Pos

func (*NestedIdentifier) String

func (n *NestedIdentifier) String(int) string

type NestedTypeExpr

type NestedTypeExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	Name          *Ident
	Columns       []Expr
}

func (*NestedTypeExpr) End

func (n *NestedTypeExpr) End() Pos

func (*NestedTypeExpr) Pos

func (n *NestedTypeExpr) Pos() Pos

func (*NestedTypeExpr) String

func (n *NestedTypeExpr) String(level int) string

type NotExpr

type NotExpr struct {
	NotPos Pos
	Expr   Expr
}

func (*NotExpr) End

func (n *NotExpr) End() Pos

func (*NotExpr) Pos

func (n *NotExpr) Pos() Pos

func (*NotExpr) String

func (n *NotExpr) String(level int) string

type NotNullLiteral

type NotNullLiteral struct {
	NotPos      Pos
	NullLiteral *NullLiteral
}

func (*NotNullLiteral) End

func (n *NotNullLiteral) End() Pos

func (*NotNullLiteral) Pos

func (n *NotNullLiteral) Pos() Pos

func (*NotNullLiteral) String

func (n *NotNullLiteral) String(int) string

type NullLiteral

type NullLiteral struct {
	NullPos Pos
}

func (*NullLiteral) End

func (n *NullLiteral) End() Pos

func (*NullLiteral) Pos

func (n *NullLiteral) Pos() Pos

func (*NullLiteral) String

func (n *NullLiteral) String(int) string

type NumberLiteral

type NumberLiteral struct {
	NumPos  Pos
	NumEnd  Pos
	Literal string
	Base    int
}

func (*NumberLiteral) End

func (n *NumberLiteral) End() Pos

func (*NumberLiteral) Pos

func (n *NumberLiteral) Pos() Pos

func (*NumberLiteral) String

func (n *NumberLiteral) String(int) string

type ObjectParams

type ObjectParams struct {
	Object Expr
	Params *ArrayParamList
}

func (*ObjectParams) End

func (o *ObjectParams) End() Pos

func (*ObjectParams) Pos

func (o *ObjectParams) Pos() Pos

func (*ObjectParams) String

func (o *ObjectParams) String(level int) string

type OnClusterExpr

type OnClusterExpr struct {
	OnPos Pos
	Expr  Expr
}

func (*OnClusterExpr) End

func (o *OnClusterExpr) End() Pos

func (*OnClusterExpr) Pos

func (o *OnClusterExpr) Pos() Pos

func (*OnClusterExpr) String

func (o *OnClusterExpr) String(level int) string

type OnExpr

type OnExpr struct {
	OnPos Pos
	On    *ColumnExprList
}

func (*OnExpr) End

func (o *OnExpr) End() Pos

func (*OnExpr) Pos

func (o *OnExpr) Pos() Pos

func (*OnExpr) String

func (o *OnExpr) String(level int) string

type OpType

type OpType string

type OperationExpr

type OperationExpr struct {
	OperationPos Pos
	Kind         TokenKind
}

func (*OperationExpr) End

func (o *OperationExpr) End() Pos

func (*OperationExpr) Pos

func (o *OperationExpr) Pos() Pos

func (*OperationExpr) String

func (o *OperationExpr) String(int) string

type OptimizeExpr added in v0.3.0

type OptimizeExpr struct {
	OptimizePos  Pos
	StatementEnd Pos
	Table        *TableIdentifier
	OnCluster    *OnClusterExpr
	Partition    *PartitionExpr
	HasFinal     bool
	Deduplicate  *DeduplicateExpr
}

func (*OptimizeExpr) End added in v0.3.0

func (o *OptimizeExpr) End() Pos

func (*OptimizeExpr) Pos added in v0.3.0

func (o *OptimizeExpr) Pos() Pos

func (*OptimizeExpr) String added in v0.3.0

func (o *OptimizeExpr) String(level int) string

type OrderByExpr

type OrderByExpr struct {
	OrderPos  Pos
	Expr      Expr
	Direction OrderDirection
}

func (*OrderByExpr) End

func (o *OrderByExpr) End() Pos

func (*OrderByExpr) Pos

func (o *OrderByExpr) Pos() Pos

func (*OrderByExpr) String

func (o *OrderByExpr) String(level int) string

type OrderByListExpr

type OrderByListExpr struct {
	OrderPos Pos
	ListEnd  Pos
	Items    []Expr
}

func (*OrderByListExpr) End

func (o *OrderByListExpr) End() Pos

func (*OrderByListExpr) Pos

func (o *OrderByListExpr) Pos() Pos

func (*OrderByListExpr) String

func (o *OrderByListExpr) String(level int) string

type OrderDirection

type OrderDirection string
const (
	OrderDirectionNone OrderDirection = "None"
	OrderDirectionAsc  OrderDirection = "ASC"
	OrderDirectionDesc OrderDirection = "DESC"
)

type ParamExprList

type ParamExprList struct {
	LeftParenPos  Pos
	RightParenPos Pos
	Items         *ColumnExprList
	ColumnArgList *ColumnArgList
}

func (*ParamExprList) End

func (f *ParamExprList) End() Pos

func (*ParamExprList) Pos

func (f *ParamExprList) Pos() Pos

func (*ParamExprList) String

func (f *ParamExprList) String(level int) string

type Parser

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

func NewParser

func NewParser(buffer string) *Parser

func (*Parser) ParseNestedIdentifier

func (p *Parser) ParseNestedIdentifier(_ Pos) (*NestedIdentifier, error)

func (*Parser) ParseStatements

func (p *Parser) ParseStatements() ([]Expr, error)

func (*Parser) Pos

func (p *Parser) Pos() Pos

type PartitionByExpr

type PartitionByExpr struct {
	PartitionPos Pos
	Expr         Expr
}

func (*PartitionByExpr) End

func (p *PartitionByExpr) End() Pos

func (*PartitionByExpr) Pos

func (p *PartitionByExpr) Pos() Pos

func (*PartitionByExpr) String

func (p *PartitionByExpr) String(level int) string

type PartitionExpr

type PartitionExpr struct {
	PartitionPos Pos
	Expr         Expr
	ID           *StringLiteral
	All          bool
}

func (*PartitionExpr) End

func (p *PartitionExpr) End() Pos

func (*PartitionExpr) Pos

func (p *PartitionExpr) Pos() Pos

func (*PartitionExpr) String

func (p *PartitionExpr) String(level int) string

type Pos

type Pos int

type PrewhereExpr

type PrewhereExpr struct {
	PrewherePos Pos
	Expr        Expr
}

func (*PrewhereExpr) End

func (w *PrewhereExpr) End() Pos

func (*PrewhereExpr) Pos

func (w *PrewhereExpr) Pos() Pos

func (*PrewhereExpr) String

func (w *PrewhereExpr) String(level int) string

type PrimaryKeyExpr

type PrimaryKeyExpr struct {
	PrimaryPos Pos
	Expr       Expr
}

func (*PrimaryKeyExpr) End

func (p *PrimaryKeyExpr) End() Pos

func (*PrimaryKeyExpr) Pos

func (p *PrimaryKeyExpr) Pos() Pos

func (*PrimaryKeyExpr) String

func (p *PrimaryKeyExpr) String(level int) string

type PropertyTypeExpr

type PropertyTypeExpr struct {
	Name *Ident
}

func (*PropertyTypeExpr) End

func (c *PropertyTypeExpr) End() Pos

func (*PropertyTypeExpr) Pos

func (c *PropertyTypeExpr) Pos() Pos

func (*PropertyTypeExpr) String

func (c *PropertyTypeExpr) String(level int) string

type RemovePropertyType

type RemovePropertyType struct {
	RemovePos Pos

	PropertyType Expr
}

func (*RemovePropertyType) End

func (a *RemovePropertyType) End() Pos

func (*RemovePropertyType) Pos

func (a *RemovePropertyType) Pos() Pos

func (*RemovePropertyType) String

func (a *RemovePropertyType) String(level int) string

type SampleByExpr

type SampleByExpr struct {
	SamplePos Pos
	Expr      Expr
}

func (*SampleByExpr) End

func (s *SampleByExpr) End() Pos

func (*SampleByExpr) Pos

func (s *SampleByExpr) Pos() Pos

func (*SampleByExpr) String

func (s *SampleByExpr) String(level int) string

type SampleRatioExpr

type SampleRatioExpr struct {
	SamplePos Pos
	Ratio     *FloatLiteral
	Offset    *FloatLiteral
}

func (*SampleRatioExpr) End

func (s *SampleRatioExpr) End() Pos

func (*SampleRatioExpr) Pos

func (s *SampleRatioExpr) Pos() Pos

func (*SampleRatioExpr) String

func (s *SampleRatioExpr) String(level int) string

type ScalarTypeExpr

type ScalarTypeExpr struct {
	Name *Ident
}

func (*ScalarTypeExpr) End

func (s *ScalarTypeExpr) End() Pos

func (*ScalarTypeExpr) Pos

func (s *ScalarTypeExpr) Pos() Pos

func (*ScalarTypeExpr) String

func (s *ScalarTypeExpr) String(level int) string

type SelectQuery added in v0.3.0

type SelectQuery struct {
	SelectPos     Pos
	StatementEnd  Pos
	With          *WithExpr
	Top           *TopExpr
	SelectColumns *ColumnExprList
	From          *FromExpr
	ArrayJoin     *ArrayJoinExpr
	Window        *WindowExpr
	Prewhere      *PrewhereExpr
	Where         *WhereExpr
	GroupBy       *GroupByExpr
	WithTotal     bool
	Having        *HavingExpr
	OrderBy       *OrderByListExpr
	LimitBy       *LimitByExpr
	Settings      *SettingsExprList
	UnionAll      *SelectQuery
}

func (*SelectQuery) End added in v0.3.0

func (s *SelectQuery) End() Pos

func (*SelectQuery) Pos added in v0.3.0

func (s *SelectQuery) Pos() Pos

func (*SelectQuery) String added in v0.3.0

func (s *SelectQuery) String(level int) string

type Set

type Set[T comparable] struct {
	// contains filtered or unexported fields
}

func NewSet

func NewSet[T comparable](members ...T) *Set[T]

func (*Set[T]) Add

func (s *Set[T]) Add(member T)

func (*Set[T]) Contains

func (s *Set[T]) Contains(member T) bool

func (*Set[T]) Members

func (s *Set[T]) Members() []T

func (*Set[T]) Remove

func (s *Set[T]) Remove(member T)

type SetExpr

type SetExpr struct {
	SetPos   Pos
	Settings *SettingsExprList
}

func (*SetExpr) End

func (s *SetExpr) End() Pos

func (*SetExpr) Pos

func (s *SetExpr) Pos() Pos

func (*SetExpr) String

func (s *SetExpr) String(level int) string

type SettingsExpr

type SettingsExpr struct {
	SettingsPos Pos
	Name        *Ident
	Expr        Expr
}

func (*SettingsExpr) End

func (s *SettingsExpr) End() Pos

func (*SettingsExpr) Pos

func (s *SettingsExpr) Pos() Pos

func (*SettingsExpr) String

func (s *SettingsExpr) String(level int) string

type SettingsExprList

type SettingsExprList struct {
	SettingsPos Pos
	ListEnd     Pos
	Items       []*SettingsExpr
}

func (*SettingsExprList) End

func (s *SettingsExprList) End() Pos

func (*SettingsExprList) Pos

func (s *SettingsExprList) Pos() Pos

func (*SettingsExprList) String

func (s *SettingsExprList) String(level int) string

type StringLiteral

type StringLiteral struct {
	LiteralPos Pos
	LiteralEnd Pos
	Literal    string
}

func (*StringLiteral) End

func (s *StringLiteral) End() Pos

func (*StringLiteral) Pos

func (s *StringLiteral) Pos() Pos

func (*StringLiteral) String

func (s *StringLiteral) String(int) string

type SubQueryExpr

type SubQueryExpr struct {
	AsPos  Pos
	Select *SelectQuery
}

func (*SubQueryExpr) End

func (s *SubQueryExpr) End() Pos

func (*SubQueryExpr) Pos

func (s *SubQueryExpr) Pos() Pos

func (*SubQueryExpr) String

func (s *SubQueryExpr) String(level int) string

type SystemCtrlExpr

type SystemCtrlExpr struct {
	CtrlPos      Pos
	StatementEnd Pos
	Command      string // START, STOP
	Type         string // REPLICATED, DISTRIBUTED
	Cluster      *TableIdentifier
}

func (*SystemCtrlExpr) End

func (s *SystemCtrlExpr) End() Pos

func (*SystemCtrlExpr) Pos

func (s *SystemCtrlExpr) Pos() Pos

func (*SystemCtrlExpr) String

func (s *SystemCtrlExpr) String(level int) string

type SystemDropExpr

type SystemDropExpr struct {
	DropPos      Pos
	StatementEnd Pos
	Type         string
}

func (*SystemDropExpr) End

func (s *SystemDropExpr) End() Pos

func (*SystemDropExpr) Pos

func (s *SystemDropExpr) Pos() Pos

func (*SystemDropExpr) String

func (s *SystemDropExpr) String(level int) string

type SystemExpr

type SystemExpr struct {
	SystemPos Pos
	Expr      Expr
}

func (*SystemExpr) End

func (s *SystemExpr) End() Pos

func (*SystemExpr) Pos

func (s *SystemExpr) Pos() Pos

func (*SystemExpr) String

func (s *SystemExpr) String(level int) string

type SystemFlushExpr

type SystemFlushExpr struct {
	FlushPos     Pos
	StatementEnd Pos
	Logs         bool
	Distributed  *TableIdentifier
}

func (*SystemFlushExpr) End

func (s *SystemFlushExpr) End() Pos

func (*SystemFlushExpr) Pos

func (s *SystemFlushExpr) Pos() Pos

func (*SystemFlushExpr) String

func (s *SystemFlushExpr) String(level int) string

type SystemReloadExpr

type SystemReloadExpr struct {
	ReloadPos    Pos
	StatementEnd Pos
	Dictionary   *TableIdentifier
	Type         string
}

func (*SystemReloadExpr) End

func (s *SystemReloadExpr) End() Pos

func (*SystemReloadExpr) Pos

func (s *SystemReloadExpr) Pos() Pos

func (*SystemReloadExpr) String

func (s *SystemReloadExpr) String(level int) string

type SystemSyncExpr

type SystemSyncExpr struct {
	SyncPos Pos
	Cluster *TableIdentifier
}

func (*SystemSyncExpr) End

func (s *SystemSyncExpr) End() Pos

func (*SystemSyncExpr) Pos

func (s *SystemSyncExpr) Pos() Pos

func (*SystemSyncExpr) String

func (s *SystemSyncExpr) String(level int) string

type TTLExpr

type TTLExpr struct {
	TTLPos Pos
	Expr   Expr
}

func (*TTLExpr) End

func (t *TTLExpr) End() Pos

func (*TTLExpr) Pos

func (t *TTLExpr) Pos() Pos

func (*TTLExpr) String

func (t *TTLExpr) String(level int) string

type TTLExprList

type TTLExprList struct {
	TTLPos  Pos
	ListEnd Pos
	Items   []*TTLExpr
}

func (*TTLExprList) End

func (t *TTLExprList) End() Pos

func (*TTLExprList) Pos

func (t *TTLExprList) Pos() Pos

func (*TTLExprList) String

func (t *TTLExprList) String(level int) string

type TableArgListExpr

type TableArgListExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	Args          []Expr
}

func (*TableArgListExpr) End

func (t *TableArgListExpr) End() Pos

func (*TableArgListExpr) Pos

func (t *TableArgListExpr) Pos() Pos

func (*TableArgListExpr) String

func (t *TableArgListExpr) String(level int) string

type TableExpr

type TableExpr struct {
	TablePos Pos
	TableEnd Pos
	Alias    *AliasExpr
	Expr     Expr
}

func (*TableExpr) End

func (t *TableExpr) End() Pos

func (*TableExpr) Pos

func (t *TableExpr) Pos() Pos

func (*TableExpr) String

func (t *TableExpr) String(level int) string

type TableFunctionExpr

type TableFunctionExpr struct {
	Name *Ident
	Args *TableArgListExpr
}

func (*TableFunctionExpr) End

func (t *TableFunctionExpr) End() Pos

func (*TableFunctionExpr) Pos

func (t *TableFunctionExpr) Pos() Pos

func (*TableFunctionExpr) String

func (t *TableFunctionExpr) String(level int) string

type TableIdentifier

type TableIdentifier struct {
	Database *Ident
	Table    *Ident
}

func (*TableIdentifier) End

func (t *TableIdentifier) End() Pos

func (*TableIdentifier) Pos

func (t *TableIdentifier) Pos() Pos

func (*TableIdentifier) String

func (t *TableIdentifier) String(int) string

type TableIndex

type TableIndex struct {
	IndexPos Pos

	Name        *NestedIdentifier
	ColumnExpr  Expr
	ColumnType  Expr
	Granularity *NumberLiteral
}

func (*TableIndex) End

func (a *TableIndex) End() Pos

func (*TableIndex) Pos

func (a *TableIndex) Pos() Pos

func (*TableIndex) String

func (a *TableIndex) String(level int) string

type TableSchemaExpr

type TableSchemaExpr struct {
	SchemaPos     Pos
	SchemaEnd     Pos
	Columns       []Expr
	AliasTable    *TableIdentifier
	TableFunction *TableFunctionExpr
}

func (*TableSchemaExpr) End

func (t *TableSchemaExpr) End() Pos

func (*TableSchemaExpr) Pos

func (t *TableSchemaExpr) Pos() Pos

func (*TableSchemaExpr) String

func (t *TableSchemaExpr) String(level int) string

type TernaryExpr

type TernaryExpr struct {
	Condition Expr
	TrueExpr  Expr
	FalseExpr Expr
}

func (*TernaryExpr) End

func (t *TernaryExpr) End() Pos

func (*TernaryExpr) Pos

func (t *TernaryExpr) Pos() Pos

func (*TernaryExpr) String

func (t *TernaryExpr) String(level int) string

type Token

type Token struct {
	Pos Pos
	End Pos

	Kind     TokenKind
	String   string
	Base     int // 10 or 16 on TokenInt
	Unquoted bool
}

type TokenKind

type TokenKind string
const (
	TokenEOF     TokenKind = "<eof>"
	TokenIdent   TokenKind = "<ident>"
	TokenKeyword TokenKind = "<keyword>"
	TokenInt     TokenKind = "<int>"
	TokenFloat   TokenKind = "<float>"
	TokenString  TokenKind = "<string>"
	TokenCast    TokenKind = "<cast>"
	TokenArrow   TokenKind = "<arrow>"
)

type TopExpr

type TopExpr struct {
	TopPos   Pos
	TopEnd   Pos
	Number   *NumberLiteral
	WithTies bool
}

func (*TopExpr) End

func (t *TopExpr) End() Pos

func (*TopExpr) Pos

func (t *TopExpr) Pos() Pos

func (*TopExpr) String

func (t *TopExpr) String(int) string

type TruncateTable

type TruncateTable struct {
	TruncatePos  Pos
	StatementEnd Pos
	IsTemporary  bool
	IfExists     bool
	Name         *TableIdentifier
	OnCluster    *OnClusterExpr
}

func (*TruncateTable) End

func (t *TruncateTable) End() Pos

func (*TruncateTable) Pos

func (t *TruncateTable) Pos() Pos

func (*TruncateTable) String

func (t *TruncateTable) String(level int) string

func (*TruncateTable) Type

func (t *TruncateTable) Type() string

type TypeWithParamsExpr added in v0.3.0

type TypeWithParamsExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	Name          *Ident
	Params        []Literal
}

func (*TypeWithParamsExpr) End added in v0.3.0

func (s *TypeWithParamsExpr) End() Pos

func (*TypeWithParamsExpr) Pos added in v0.3.0

func (s *TypeWithParamsExpr) Pos() Pos

func (*TypeWithParamsExpr) String added in v0.3.0

func (s *TypeWithParamsExpr) String(level int) string

type UUID

type UUID struct {
	Value *StringLiteral
}

func (*UUID) End

func (u *UUID) End() Pos

func (*UUID) Pos

func (u *UUID) Pos() Pos

func (*UUID) String

func (u *UUID) String(level int) string

type UnaryExpr added in v0.3.0

type UnaryExpr struct {
	UnaryPos Pos
	Kind     TokenKind
	Expr     Expr
}

func (*UnaryExpr) End added in v0.3.0

func (n *UnaryExpr) End() Pos

func (*UnaryExpr) Pos added in v0.3.0

func (n *UnaryExpr) Pos() Pos

func (*UnaryExpr) String added in v0.3.0

func (n *UnaryExpr) String(level int) string

type UseExpr

type UseExpr struct {
	UsePos       Pos
	StatementEnd Pos
	Database     *Ident
}

func (*UseExpr) End

func (u *UseExpr) End() Pos

func (*UseExpr) Pos

func (u *UseExpr) Pos() Pos

func (*UseExpr) String

func (u *UseExpr) String(level int) string

type UsingExpr

type UsingExpr struct {
	UsingPos Pos
	Using    *ColumnExprList
}

func (*UsingExpr) End

func (u *UsingExpr) End() Pos

func (*UsingExpr) Pos

func (u *UsingExpr) Pos() Pos

func (*UsingExpr) String

func (u *UsingExpr) String(level int) string

type ValuesExpr added in v0.3.0

type ValuesExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	Values        []Expr
}

func (*ValuesExpr) End added in v0.3.0

func (v *ValuesExpr) End() Pos

func (*ValuesExpr) Pos added in v0.3.0

func (v *ValuesExpr) Pos() Pos

func (*ValuesExpr) String added in v0.3.0

func (v *ValuesExpr) String(level int) string

type WhenExpr

type WhenExpr struct {
	WhenPos Pos
	ThenPos Pos
	When    Expr
	Then    Expr
	ElsePos Pos
	Else    Expr
}

func (*WhenExpr) End

func (w *WhenExpr) End() Pos

func (*WhenExpr) Pos

func (w *WhenExpr) Pos() Pos

func (*WhenExpr) String

func (w *WhenExpr) String(level int) string

type WhereExpr

type WhereExpr struct {
	WherePos Pos
	Expr     Expr
}

func (*WhereExpr) End

func (w *WhereExpr) End() Pos

func (*WhereExpr) Pos

func (w *WhereExpr) Pos() Pos

func (*WhereExpr) String

func (w *WhereExpr) String(level int) string

type WindowConditionExpr

type WindowConditionExpr struct {
	LeftParenPos  Pos
	RightParenPos Pos
	PartitionBy   *PartitionByExpr
	OrderBy       *OrderByListExpr
	Frame         *WindowFrameExpr
}

func (*WindowConditionExpr) End

func (w *WindowConditionExpr) End() Pos

func (*WindowConditionExpr) Pos

func (w *WindowConditionExpr) Pos() Pos

func (*WindowConditionExpr) String

func (w *WindowConditionExpr) String(level int) string

type WindowExpr

type WindowExpr struct {
	*WindowConditionExpr

	WindowPos Pos
	Name      *Ident
	AsPos     Pos
}

func (*WindowExpr) End

func (w *WindowExpr) End() Pos

func (*WindowExpr) Pos

func (w *WindowExpr) Pos() Pos

func (*WindowExpr) String

func (w *WindowExpr) String(level int) string

type WindowFrameCurrentRow

type WindowFrameCurrentRow struct {
	CurrentPos Pos
	RowEnd     Pos
}

func (*WindowFrameCurrentRow) End

func (f *WindowFrameCurrentRow) End() Pos

func (*WindowFrameCurrentRow) Pos

func (f *WindowFrameCurrentRow) Pos() Pos

func (*WindowFrameCurrentRow) String

func (f *WindowFrameCurrentRow) String(int) string

type WindowFrameExpr

type WindowFrameExpr struct {
	FramePos Pos
	Type     string
	Extend   Expr
}

func (*WindowFrameExpr) End

func (f *WindowFrameExpr) End() Pos

func (*WindowFrameExpr) Pos

func (f *WindowFrameExpr) Pos() Pos

func (*WindowFrameExpr) String

func (f *WindowFrameExpr) String(level int) string

type WindowFrameExtendExpr

type WindowFrameExtendExpr struct {
	Expr Expr
}

func (*WindowFrameExtendExpr) End

func (f *WindowFrameExtendExpr) End() Pos

func (*WindowFrameExtendExpr) Pos

func (f *WindowFrameExtendExpr) Pos() Pos

func (*WindowFrameExtendExpr) String

func (f *WindowFrameExtendExpr) String(int) string

type WindowFrameNumber

type WindowFrameNumber struct {
	Number       *NumberLiteral
	UnboundedEnd Pos
	Direction    string
}

func (*WindowFrameNumber) End

func (f *WindowFrameNumber) End() Pos

func (*WindowFrameNumber) Pos

func (f *WindowFrameNumber) Pos() Pos

func (*WindowFrameNumber) String

func (f *WindowFrameNumber) String(level int) string

type WindowFrameRangeExpr

type WindowFrameRangeExpr struct {
	BetweenPos  Pos
	BetweenExpr Expr
	AndPos      Pos
	AndExpr     Expr
}

func (*WindowFrameRangeExpr) End

func (f *WindowFrameRangeExpr) End() Pos

func (*WindowFrameRangeExpr) Pos

func (f *WindowFrameRangeExpr) Pos() Pos

func (*WindowFrameRangeExpr) String

func (f *WindowFrameRangeExpr) String(level int) string

type WindowFrameUnbounded

type WindowFrameUnbounded struct {
	UnboundedPos Pos
	UnboundedEnd Pos
	Direction    string
}

func (*WindowFrameUnbounded) End

func (f *WindowFrameUnbounded) End() Pos

func (*WindowFrameUnbounded) Pos

func (f *WindowFrameUnbounded) Pos() Pos

func (*WindowFrameUnbounded) String

func (f *WindowFrameUnbounded) String(int) string

type WindowFunctionExpr

type WindowFunctionExpr struct {
	Function *FunctionExpr
	OverPos  Pos
	OverExpr Expr
}

func (*WindowFunctionExpr) End

func (w *WindowFunctionExpr) End() Pos

func (*WindowFunctionExpr) Pos

func (w *WindowFunctionExpr) Pos() Pos

func (*WindowFunctionExpr) String

func (w *WindowFunctionExpr) String(level int) string

type WithExpr

type WithExpr struct {
	WithPos Pos
	EndPos  Pos
	CTEs    []*CTEExpr
}

func (*WithExpr) End

func (w *WithExpr) End() Pos

func (*WithExpr) Pos

func (w *WithExpr) Pos() Pos

func (*WithExpr) String

func (w *WithExpr) String(level int) string

type WithTimeoutExpr

type WithTimeoutExpr struct {
	WithTimeoutPos Pos
	Expr           Expr
	Number         *NumberLiteral
}

func (*WithTimeoutExpr) End

func (w *WithTimeoutExpr) End() Pos

func (*WithTimeoutExpr) Pos

func (w *WithTimeoutExpr) Pos() Pos

func (*WithTimeoutExpr) String

func (w *WithTimeoutExpr) String(int) string

Jump to

Keyboard shortcuts

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