snowflake

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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

func ExtractSnowSQLOrdinaryIdentifier(identifier string) string

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 GetStatementRanges(_ context.Context, _ base.StatementRangeContext, statement string) ([]base.Range, error)

func IsSnowflakeKeyword

func IsSnowflakeKeyword(s string, caseSensitive bool) bool

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.

func SplitSQL

func SplitSQL(statement string) ([]base.SingleSQL, error)

SplitSQL splits the given SQL statement into multiple SQL statements using ANTLR lexer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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