Skip to content
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

Use quotes when referencing columns #1059

Merged
merged 5 commits into from
Aug 31, 2024
Merged

Use quotes when referencing columns #1059

merged 5 commits into from
Aug 31, 2024

Conversation

jwoertink
Copy link
Member

Fixes #792

This PR changes up how the SQL is generated so all columns references are wrapped in quotes. This allows you to create column names that are the same as reserved SQL words like from or order, etc... In the future we will also be able to connect to columns with special characters like a column named read?, though I can't do that in this PR.

Copy link
Contributor

@robacarp robacarp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this change, it's simple and adds robustness to avram.

spec/avram/bool_criteria_spec.cr Outdated Show resolved Hide resolved
@jwoertink jwoertink mentioned this pull request Aug 25, 2024
@jwoertink jwoertink marked this pull request as ready for review August 25, 2024 22:05
@jwoertink jwoertink changed the title [WIP] Use quotes when referencing columns Use quotes when referencing columns Aug 25, 2024
@jwoertink jwoertink merged commit bb63db8 into main Aug 31, 2024
9 checks passed
@jwoertink jwoertink deleted the issues/792 branch August 31, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use double quotes when referencing database objects
2 participants