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

Quote all identifiers in SQL implicitly #4385

Closed
mvorisek opened this issue Oct 24, 2020 · 5 comments
Closed

Quote all identifiers in SQL implicitly #4385

mvorisek opened this issue Oct 24, 2020 · 5 comments

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Oct 24, 2020

see https://github.com/doctrine/dbal/pull/4360/files#diff-260f15d92dacb5c7db10faacb895b841a9b843c53b7b46455ae4e0a442a655a9R41

wdyt about to quote all identifiers in SQL implicitly (instead of explicitly), ie.

  • set quoted by default to true
  • forbid use of quoted name as string
  • allow unquoted names (for BC) by setting quoted = false
  • maybe renamed quoted to unquoted - but this will be breaking because of changed names

I very strongly support this idea as it will prevent all issues with dangerously left unquoted/unsupported names and still allow to use unquoted names.

I propose this for 3.x

@mvorisek mvorisek changed the title Quote implicitly Quote identifiers implicitly Oct 24, 2020
@mvorisek mvorisek changed the title Quote identifiers implicitly Quote all identifiers implicitly Oct 24, 2020
@mvorisek mvorisek changed the title Quote all identifiers implicitly Quote all identifiers in SQL implicitly Oct 24, 2020
@greg0ire
Copy link
Member

Does it relate to #4357 ?

@mvorisek
Copy link
Contributor Author

Does it relate to #4357 ?

Yes, #4357 is statement about a problem, this issue is how to solve it.

@greg0ire
Copy link
Member

You may try to find more information in existing issues, I think #4357 is rooted in previous experiences, and I have a vague memory of quoting everything not being an option. Otherwise, let's just wait for the promised information in #4357

@morozov
Copy link
Member

morozov commented Jul 15, 2022

We can't quote identifiers automatically because a lot of APIs already accept a string that may be a quoted or a non-quoted identifier. At this point, we don't know if it needs to be quoted or not. This issue is tracked in #4772.

@morozov morozov closed this as completed Jul 15, 2022
@morozov morozov closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants