Documentation
¶
Index ¶
- Variables
- func CompareSQL(sql1, sql2 string) bool
- func NormalizeSQL(sql string) string
- type AlterTableParser
- type CommentParser
- type CompressionPolicyParser
- type Config
- type ContinuousAggregatePolicyParser
- type DoBlockParser
- type ExtensionParser
- type FunctionParser
- type HypertableParser
- type IdentifierNormalizer
- func (n *IdentifierNormalizer) IsKeyword(ident string) bool
- func (n *IdentifierNormalizer) IsQuoted(ident string) bool
- func (n *IdentifierNormalizer) IsValidIdentifier(ident string) bool
- func (n *IdentifierNormalizer) Normalize(ident string) string
- func (n *IdentifierNormalizer) QuoteIfNeeded(ident string) string
- func (n *IdentifierNormalizer) SplitQualified(qualified string) (schemaName, objectName string)
- func (n *IdentifierNormalizer) Unquote(ident string) string
- type IndexParser
- type Lexer
- type MaterializedViewParser
- type Option
- type ParseError
- type Parser
- func (p *Parser) GetErrors() []ParseError
- func (p *Parser) GetWarnings() []Warning
- func (p *Parser) ParseDirectory(dirPath string) (*Result, error)
- func (p *Parser) ParseFile(filePath string, db *schema.Database) error
- func (p *Parser) ParseFileWithoutProcessingDeferred(filePath string, db *schema.Database) error
- func (p *Parser) ParseSQL(sql string, db *schema.Database) error
- func (p *Parser) ProcessDeferredPartitions(db *schema.Database) error
- type ParserRegistry
- type Result
- type RetentionPolicyParser
- type SchemaParser
- type SequenceParser
- type Statement
- type StatementParser
- type StatementType
- type TableParser
- type Token
- type TokenType
- type TriggerParser
- type TypeParser
- type ViewParser
- type Warning
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CompareSQL ¶
func NormalizeSQL ¶
Types ¶
type AlterTableParser ¶
type AlterTableParser struct{}
func NewAlterTableParser ¶
func NewAlterTableParser() *AlterTableParser
func (*AlterTableParser) StatementTypes ¶
func (p *AlterTableParser) StatementTypes() []StatementType
type CommentParser ¶
type CommentParser struct{}
func NewCommentParser ¶
func NewCommentParser() *CommentParser
func (*CommentParser) StatementTypes ¶
func (p *CommentParser) StatementTypes() []StatementType
type CompressionPolicyParser ¶
type CompressionPolicyParser struct{}
func NewCompressionPolicyParser ¶
func NewCompressionPolicyParser() *CompressionPolicyParser
func (*CompressionPolicyParser) StatementTypes ¶
func (p *CompressionPolicyParser) StatementTypes() []StatementType
type ContinuousAggregatePolicyParser ¶
type ContinuousAggregatePolicyParser struct{}
func NewContinuousAggregatePolicyParser ¶
func NewContinuousAggregatePolicyParser() *ContinuousAggregatePolicyParser
func (*ContinuousAggregatePolicyParser) StatementTypes ¶
func (p *ContinuousAggregatePolicyParser) StatementTypes() []StatementType
type DoBlockParser ¶
type DoBlockParser struct{}
func NewDoBlockParser ¶
func NewDoBlockParser() *DoBlockParser
func (*DoBlockParser) StatementTypes ¶
func (p *DoBlockParser) StatementTypes() []StatementType
type ExtensionParser ¶
type ExtensionParser struct {
// contains filtered or unexported fields
}
func NewExtensionParser ¶
func NewExtensionParser() *ExtensionParser
func (*ExtensionParser) StatementTypes ¶
func (p *ExtensionParser) StatementTypes() []StatementType
type FunctionParser ¶
type FunctionParser struct{}
func NewFunctionParser ¶
func NewFunctionParser() *FunctionParser
func (*FunctionParser) StatementTypes ¶
func (p *FunctionParser) StatementTypes() []StatementType
type HypertableParser ¶
type HypertableParser struct{}
func NewHypertableParser ¶
func NewHypertableParser() *HypertableParser
func (*HypertableParser) StatementTypes ¶
func (p *HypertableParser) StatementTypes() []StatementType
type IdentifierNormalizer ¶
type IdentifierNormalizer struct {
// contains filtered or unexported fields
}
func NewIdentifierNormalizer ¶
func NewIdentifierNormalizer(caseSensitive bool) *IdentifierNormalizer
func (*IdentifierNormalizer) IsKeyword ¶
func (n *IdentifierNormalizer) IsKeyword(ident string) bool
func (*IdentifierNormalizer) IsQuoted ¶
func (n *IdentifierNormalizer) IsQuoted(ident string) bool
func (*IdentifierNormalizer) IsValidIdentifier ¶
func (n *IdentifierNormalizer) IsValidIdentifier(ident string) bool
func (*IdentifierNormalizer) Normalize ¶
func (n *IdentifierNormalizer) Normalize(ident string) string
func (*IdentifierNormalizer) QuoteIfNeeded ¶
func (n *IdentifierNormalizer) QuoteIfNeeded(ident string) string
func (*IdentifierNormalizer) SplitQualified ¶
func (n *IdentifierNormalizer) SplitQualified(qualified string) (schemaName, objectName string)
func (*IdentifierNormalizer) Unquote ¶
func (n *IdentifierNormalizer) Unquote(ident string) string
type IndexParser ¶
type IndexParser struct{}
func NewIndexParser ¶
func NewIndexParser() *IndexParser
func (*IndexParser) StatementTypes ¶
func (p *IndexParser) StatementTypes() []StatementType
type MaterializedViewParser ¶
type MaterializedViewParser struct{}
func NewMaterializedViewParser ¶
func NewMaterializedViewParser() *MaterializedViewParser
func (*MaterializedViewParser) StatementTypes ¶
func (p *MaterializedViewParser) StatementTypes() []StatementType
type ParseError ¶
func NewParseError ¶
func NewParseError(message string) ParseError
func WrapParseError ¶
func WrapParseError(err error, message string) ParseError
func (ParseError) Error ¶
func (e ParseError) Error() string
func (ParseError) Unwrap ¶
func (e ParseError) Unwrap() error
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) GetErrors ¶
func (p *Parser) GetErrors() []ParseError
func (*Parser) GetWarnings ¶
func (*Parser) ParseFileWithoutProcessingDeferred ¶
type ParserRegistry ¶
type ParserRegistry struct {
// contains filtered or unexported fields
}
func NewParserRegistry ¶
func NewParserRegistry() *ParserRegistry
func (*ParserRegistry) Get ¶
func (r *ParserRegistry) Get(stmtType StatementType) StatementParser
func (*ParserRegistry) Register ¶
func (r *ParserRegistry) Register(parser StatementParser)
type Result ¶
type Result struct {
Database *schema.Database
Errors []ParseError
Warnings []Warning
}
type RetentionPolicyParser ¶
type RetentionPolicyParser struct{}
func NewRetentionPolicyParser ¶
func NewRetentionPolicyParser() *RetentionPolicyParser
func (*RetentionPolicyParser) StatementTypes ¶
func (p *RetentionPolicyParser) StatementTypes() []StatementType
type SchemaParser ¶
type SchemaParser struct {
// contains filtered or unexported fields
}
func NewSchemaParser ¶
func NewSchemaParser() *SchemaParser
func (*SchemaParser) StatementTypes ¶
func (p *SchemaParser) StatementTypes() []StatementType
type SequenceParser ¶
type SequenceParser struct {
// contains filtered or unexported fields
}
func NewSequenceParser ¶
func NewSequenceParser() *SequenceParser
func (*SequenceParser) StatementTypes ¶
func (p *SequenceParser) StatementTypes() []StatementType
type Statement ¶
type Statement struct {
Type StatementType
SQL string
Tokens []Token
Line int
}
func (Statement) NormalizedSQL ¶
type StatementParser ¶
type StatementType ¶
type StatementType int
const ( StmtUnknown StatementType = iota StmtCreateTable StmtCreateIndex StmtCreateView StmtCreateMaterializedView StmtCreateFunction StmtCreateTrigger StmtCreateExtension StmtCreateType StmtCreateSequence StmtCreateSchema StmtAlterTable StmtComment StmtSelectCreateHypertable StmtSelectAddCompressionPolicy StmtSelectAddRetentionPolicy StmtSelectAddContinuousAggregatePolicy StmtDoBlock )
func DetectStatementType ¶
func DetectStatementType(tokens []Token) StatementType
type TableParser ¶
type TableParser struct{}
func NewTableParser ¶
func NewTableParser() *TableParser
func (*TableParser) StatementTypes ¶
func (p *TableParser) StatementTypes() []StatementType
type TriggerParser ¶
type TriggerParser struct{}
func NewTriggerParser ¶
func NewTriggerParser() *TriggerParser
func (*TriggerParser) StatementTypes ¶
func (p *TriggerParser) StatementTypes() []StatementType
type TypeParser ¶
type TypeParser struct {
// contains filtered or unexported fields
}
func NewTypeParser ¶
func NewTypeParser() *TypeParser
func (*TypeParser) StatementTypes ¶
func (p *TypeParser) StatementTypes() []StatementType
type ViewParser ¶
type ViewParser struct{}
func NewViewParser ¶
func NewViewParser() *ViewParser
func (*ViewParser) StatementTypes ¶
func (p *ViewParser) StatementTypes() []StatementType
Click to show internal directories.
Click to hide internal directories.