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

Enable 'quote_names' in dbic connection args #1084

Closed
osfameron opened this issue Mar 31, 2015 · 1 comment · Fixed by #2527
Closed

Enable 'quote_names' in dbic connection args #1084

osfameron opened this issue Mar 31, 2015 · 1 comment · Fixed by #2527

Comments

@osfameron
Copy link
Contributor

This setting would allow us to join to the users table without generating invalid SQL like JOIN users user as user is a reserved word.

It's not possible to simply add this, as I discovered, because there is various literal SQL that isn't correctly escaped. Also quoting searches which should work has some oddities, e.g. https://gist.githubusercontent.com/osfameron/104bb2d98879bf0b8616/raw/61d08c7ccc9982f36fe8342369607fa49c9b3be4/gistfile1.txt

There are some individual workarounds scattered around code, e.g.:

  • NOT joining users
  • manually setting the quote_name before doing something, then trying to roll back

The first makes me sad, and the 2nd is overly tricky and according to #dbix-class may be hard to properly localise so risks subtle bugs. Worth spending a bit of time to test and refactor this properly.

@racke
Copy link

racke commented Mar 31, 2015

We have a related problem in interchange/TableEditor#64, so I also would be interested in a possible solution.

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 a pull request may close this issue.

2 participants