-
Notifications
You must be signed in to change notification settings - Fork 10
Snowflake #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Snowflake #93
Changes from all commits
69adab1
685e888
58fc12b
37a89e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,6 +72,31 @@ const KEYWORDS = [ | |
| 'TRIGGERS', | ||
| 'VARIABLES', | ||
| 'WARNINGS', | ||
| 'MERGE', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these keywords valid for every dialect? Should we be scoping these somehow?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like the addition of |
||
| 'CALL', | ||
| 'GRANT', | ||
| 'REVOKE', | ||
| 'EXPLAIN', | ||
| 'DESCRIBE', | ||
| 'DESC', | ||
| 'USE', | ||
| 'COPY', | ||
| 'PUT', | ||
| 'GET', | ||
| 'LIST', | ||
| 'LS', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. certainly feels like we might need to keep snowflake-specific keywords out of the global tokenizer list and scope them based on dialect |
||
| 'REMOVE', | ||
| 'RM', | ||
| 'WAREHOUSES', | ||
| 'USERS', | ||
| 'ROLES', | ||
| 'SCHEMAS', | ||
| 'STAGES', | ||
| 'INTEGRATIONS', | ||
| 'STREAMS', | ||
| 'TASKS', | ||
| 'PIPES', | ||
| 'SEQUENCES', | ||
| ]; | ||
|
|
||
| const INDIVIDUALS: Record<string, Token['type']> = { | ||
|
|
@@ -520,7 +545,14 @@ function isDollarQuotedString(state: State): boolean { | |
| } | ||
|
|
||
| function isQuotedIdentifier(ch: Char, dialect: Dialect): boolean { | ||
| const startQuoteChars: Char[] = dialect === 'mssql' ? ['"', '['] : ['"', '`']; | ||
| let startQuoteChars: Char[]; | ||
| if (dialect === 'mssql') { | ||
| startQuoteChars = ['"', '[']; | ||
| } else if (dialect === 'snowflake') { | ||
| startQuoteChars = ['"']; | ||
| } else { | ||
| startQuoteChars = ['"', '`']; | ||
| } | ||
| return startQuoteChars.includes(ch); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are any of these Snowflake specific? Looks like we dialect-gate some below, but not these presumably because they're widely supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that PartiQL doesn't support a lot of these for example