-
Notifications
You must be signed in to change notification settings - Fork 559
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
Add support for sql variable inside query in snowflake and mysql dialect #265
Conversation
a998778
to
51a2627
Compare
Pull Request Test Coverage Report for Build 210968877
💛 - Coveralls |
Sorry for the long delay. This was previously discussed in #48, where using a custom dialect, in which @alex-dukhno recently noted that a custom dialect would fail all the Doing this in the parser results in accepting I'd appreciate it if the PR included the logic we're trying to implement, instead of simply a link to the docs. For snowflake it seems that the relevant bits are the following, and we're focused on implementing the first two only?
|
About the custom dialect i think about 2 options :
About the current PR - Do you think it's will be better if we take the whole variable as a single token ? (meanwhile with the current dialect_of macro ..) About snowflake - i don't think that i want to treat the third case different then the others , I think the "IDENTIFIER" should be parsed as a function , and the value should be expression with kind of sql-variable. |
About the general points you raised:
This seems more appropriate, yes, given the For instance implementing the "can be used in Snowflake anywhere a literal constant is allowed" requirement will require rather invasive changes to the parser. Considering other dialects will require more research. If you want to implement a subset of the Snowflake dialect that recognizes
|
Hi @nickolay developing PostgreSQL protocol compatible database I collect some knowledge around
I am wondering if based on above info your suggestion:
could be applied to |
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.
LGTM! Thanks @eyalleshem
@eyalleshem Could you rebase please so I can merge this? |
Hi @eyalleshem -- sorry for the delay in review. I am going to help out now with this repo and we are working to clear the backlog. Is this PR still something you would like to work on to help contribute? |
I am closing what look like stale PRs in this repo; I apologize in advance if this is a mistake -- please feel free to reopen if you want to keep working on this issue. |
see :
https://docs.snowflake.com/en/sql-reference/session-variables.html
https://dev.mysql.com/doc/refman/8.0/en/user-variables.html