Documentation
¶
Index ¶
- func Diagnose(_ context.Context, _ base.DiagnoseContext, statement string) ([]base.Diagnostic, error)
- func ExtractSnowSQLOrdinaryIdentifier(identifier string) string
- func GetQuerySpan(ctx context.Context, gCtx base.GetQuerySpanContext, ...) (*base.QuerySpan, error)
- func GetStatementRanges(_ context.Context, _ base.StatementRangeContext, statement string) ([]base.Range, error)
- func IsSnowflakeKeyword(s string, caseSensitive bool) bool
- func NormalizeSnowSQLObjectName(objectName parser.IObject_nameContext, ...) string
- func NormalizeSnowSQLObjectNamePart(part parser.IId_Context) string
- func NormalizeSnowSQLSchemaName(schemaName parser.ISchema_nameContext, fallbackDatabaseName string) string
- func ParseSnowSQL(sql string) ([]*base.ParseResult, error)
- func SplitSQL(statement string) ([]base.SingleSQL, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Diagnose ¶
func Diagnose(_ context.Context, _ base.DiagnoseContext, statement string) ([]base.Diagnostic, error)
func ExtractSnowSQLOrdinaryIdentifier ¶
ExtractSnowSQLOrdinaryIdentifier extracts the ordinary object name from a string. It follows the following rules:
1. If there are no double quotes on either side, it will be converted to uppercase.
2. If there are double quotes on both sides, the case will not change, the double quotes on both sides will be removed, and `""` in content will be converted to `"`.
Caller MUST ensure the identifier is VALID.
func GetQuerySpan ¶
func GetQuerySpan( ctx context.Context, gCtx base.GetQuerySpanContext, statement, database, schema string, ignoreCaseSensitive bool, ) (*base.QuerySpan, error)
GetQuerySpan returns the query span for the given statement.
func GetStatementRanges ¶
func IsSnowflakeKeyword ¶
IsSnowflakeKeyword returns true if the given string is a snowflake keyword. Follows https://docs.snowflake.com/en/sql-reference/reserved-keywords.
func NormalizeSnowSQLObjectName ¶
func NormalizeSnowSQLObjectName(objectName parser.IObject_nameContext, fallbackDatabaseName, fallbackSchemaName string) string
NormalizeSnowSQLObjectName normalizes the given object name.
func NormalizeSnowSQLObjectNamePart ¶
func NormalizeSnowSQLObjectNamePart(part parser.IId_Context) string
NormalizeSnowSQLObjectNamePart normalizes the object name part.
func NormalizeSnowSQLSchemaName ¶
func NormalizeSnowSQLSchemaName(schemaName parser.ISchema_nameContext, fallbackDatabaseName string) string
NormalizeSnowSQLSchemaName normalizes the given schema name.
func ParseSnowSQL ¶
func ParseSnowSQL(sql string) ([]*base.ParseResult, error)
ParseSnowSQL parses the given SQL and returns a list of ParseResult (one per statement). Use the Snowflake parser based on antlr4.
Types ¶
This section is empty.