-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Quote “user” table in example code with backticks #9551
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
Conversation
Naming the table “user” without backtick quoting will trigger an error for anybody that copy/pastes the code because “USER” is a SQL reserved word. See #9541 for more details.
What do you think if we rename the table to |
My reasoning for keeping `user` would be:
However, if the docs team prefers using the plural form, I don't have any strong feelings about it and can change it. Another option would be adding a little note like in #9541 and FOSUserBundle. |
There are lots of issues about this everywhere: GitHub, StackOverflow, etc. I wish Doctrine could solve this. Apparently they can't (https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/limitations-and-known-issues.html#identifier-quoting-and-legacy-databases) because of "legacy databases" ... but I wish they could. Developers shouldn't care about this: if something needs to be escaped, it should be automatically escaped 😢 Back to our docs, my preference would be to keep the quoted |
Got it. I will update the PR with the caution wording taken from the other two PRs that I referenced. |
Ping @msheakoski so you don't forget about this 😄 Thanks! |
Hi @msheakoski! I've gone ahead and merged this PR and add a modified version of your previous caution afterwards in 99fa4a1 . Please submit a new PR or add a comment here if you want to modify the wording or don't agree with the changes :) Thanks a lot for your recent security doc contributions! |
Thank you for adding that @wouterj, I think it looks great! |
* 2.8: [symfony#9551] Added caution directive explaining the backticks Quote “user” table in example code with backticks Adding guidelines for reporting violations of code of conduct
Naming the table “user” without backtick quoting will trigger an error for anybody that copy/pastes the code because “USER” is a SQL reserved word. See #9541 for more details.