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

make genned SQL easier on the eyes by removing unnecessary quotes (ex… #949

Closed
wants to merge 1 commit into from

Conversation

keredson
Copy link
Contributor

…: select id from posts instead of select "id" from "posts")

…: `select id from posts` instead of `select "id" from "posts"`)
@keredson keredson closed this May 31, 2016
@coleifer
Copy link
Owner

coleifer commented May 17, 2017

Just noting for posterity, this is a horrible suggestion because it requires:

  • The maintenance of a cross-vendor list of all SQL keywords to avoid invalid SQL (i.e. only quote names if they correspond to a SQL keyword)
  • Inspecting each named entity to see if it contains spaces or other characters that would otherwise require quoting
  • Requires re-writing hundreds of test assertions

All for ... fewer quotes in the SQL that this library is designed to abstract away. The idea is not a bad one in the sense that, yes, fewer quotes would make the sql more easy to read. But it is a bad one in the way it forces the implementation to become special-cased in numerous ways. Special cases are bad and are avoided as much as possible in peewee. It was for this latter reason, more than anything else, that this was closed without merge.

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.

None yet

2 participants