-
Notifications
You must be signed in to change notification settings - Fork 79
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
Quoted column identifiers #153
Quoted column identifiers #153
Conversation
macros/mock_builders.sql
Outdated
{%- if options.quoted_columns %} | ||
"{{ column }}" | ||
{%- else %} | ||
{{ column }} | ||
{%- endif %} |
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 new here, and was browsing the open PRs, but this seems pretty snowflake specific -- does it make sense to use the quote_identifier macro here?
It sounds like capitalized identifiers are valid, and that would dispatch to snowflake__quote_identifier which surrounds the column name in double quotes and capitalizes it:
return('"' ~ identifier | upper ~ '"')
This would let users of the library override the behaviour in their projects if needed.
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.
Thanks for the comment, Nick. You make a good point.
Coincidentally I was having the exact same conversation at a hackathon last night.
I will be updating this to a more generic/technology agnostic implementation.
EDIT: Updated it, using the quote_identifier, but I extended it with an optional preserve_case argument, as the capitalization is the thing I specifically didn't want in Snowflake.
@cdiniz , could this be merged into main? We also have the same problem for column needs quote |
a9f8aac
to
6b55b76
Compare
Hi All, |
Closes #141