Documentation
¶
Overview ¶
Package parser contains the command parser.
Index ¶
- Constants
- type AST
- type Boolean
- type ColSelector
- type ColumnDef
- type ColumnName
- type Create
- type CreateIndex
- type CreateMaterializedView
- type CreateSource
- type Drop
- type MaterializedViewOriginInformation
- type RawQuery
- type Ref
- type Show
- type SourceOriginInformation
- type SourceSetMaxRate
- type TableOption
- type TopicInfoProperty
Constants ¶
View Source
const DefaultFSP = 0
DefaultFSP is the default fractional seconds precision for a TIMESTAMP field.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AST ¶
type AST struct {
Select string // Unaltered SELECT statement, if any.
Use string `( "USE" @Ident`
Drop *Drop ` | "DROP" @@ `
Create *Create ` | "CREATE" @@ `
Show *Show ` | "SHOW" @@ `
Describe string ` | "DESCRIBE" @Ident `
SourceSetMaxRate *SourceSetMaxRate ` | "SOURCE" "SET" "MAX" "RATE" @@ `
ResetDdl string ` | "RESET" "DDL" @Ident ) ';'?`
}
AST root.
type ColSelector ¶
type ColSelector struct {
Selector string `@String`
}
type ColumnDef ¶
type ColumnDef struct {
Pos lexer.Position
Name string `@Ident`
Type common.Type `@(("VARCHAR"|"TINYINT"|"INT"|"BIGINT"|"TIMESTAMP"|"DOUBLE"|"DECIMAL"))` // Conversion done by common.Type.Capture()
Parameters []int `("(" @Number ("," @Number)* ")")?` // Optional parameters to the type(x [, x, ...])
}
func (*ColumnDef) ToColumnType ¶
func (c *ColumnDef) ToColumnType() (common.ColumnType, error)
type ColumnName ¶
type ColumnName struct {
Name string `@Ident`
}
type Create ¶
type Create struct {
MaterializedView *CreateMaterializedView ` "MATERIALIZED" "VIEW" @@`
Source *CreateSource `| "SOURCE" @@`
Index *CreateIndex `| "INDEX" @@`
}
Create statement.
type CreateIndex ¶
type CreateIndex struct {
Name string `@Ident "ON"`
TableName string `@Ident`
ColumnNames []*ColumnName `"(" @@ ("," @@)* ")"`
}
type CreateMaterializedView ¶
type CreateMaterializedView struct {
Name *Ref `@@`
OriginInformation []*MaterializedViewOriginInformation `("WITH" "(" @@ ("," @@)* ")")?`
Query *RawQuery `"AS" @@`
}
CreateMaterializedView statement.
type CreateSource ¶
type CreateSource struct {
Name string `@Ident`
Options []*TableOption `"(" @@ ("," @@)* ")"` // Table options.
OriginInformation []*SourceOriginInformation `"WITH" "(" @@ ("," @@)* ")"`
}
type Drop ¶
type Drop struct {
MaterializedView bool `( @"MATERIALIZED" "VIEW"`
Source bool ` | @"SOURCE"`
Index bool ` | @"INDEX" )`
Name string `@Ident `
TableName string `("ON" @Ident)?`
}
Drop statement
type MaterializedViewOriginInformation ¶ added in v0.1.1
type MaterializedViewOriginInformation struct {
InitialState string `"InitialState" "=" @String`
}
type Ref ¶
type Ref struct {
Path []string `@Ident ("." @Ident)*`
}
A Ref to a view, table, column, etc.
type Show ¶
type Show struct {
Tables bool `( @"TABLES"`
Schemas bool `| @"SCHEMAS"`
Indexes bool `| @"INDEXES" )`
TableName string `("ON" @Ident)?`
}
Show statement
type SourceOriginInformation ¶ added in v0.1.1
type SourceOriginInformation struct {
BrokerName string `"BrokerName" "=" @String`
TopicName string `|"TopicName" "=" @String`
HeaderEncoding string `|"HeaderEncoding" "=" @String`
KeyEncoding string `|"KeyEncoding" "=" @String`
ValueEncoding string `|"ValueEncoding" "=" @String`
IngestFilter string `|"IngestFilter" "=" @String`
InitialState string `|"InitialState" "=" @String`
Transient *Boolean `|"Transient" "=" @Ident`
ColSelectors []*selector.ColumnSelectorAST `|"ColumnSelectors" "=" "(" (@@ ("," @@)*)? ")"`
Properties []*TopicInfoProperty `|"Properties" "=" "(" (@@ ("," @@)*)? ")"`
}
type SourceSetMaxRate ¶ added in v0.1.6
type TableOption ¶
type TopicInfoProperty ¶
Click to show internal directories.
Click to hide internal directories.