Doctrine 3: Auto-escape column names #5852

Closed
opened 2026-01-22 15:19:56 +01:00 by admin · 4 comments
Owner

Originally created by @weaverryan on GitHub (Jan 23, 2018).

Hi guys!

In #5874, Ocramius mentioned that the auto-escaping of column names for reserved keywords couldn't happen for Doctrine 2, but it could happen in Doctrine 3. I couldn't find any issue in the Doctrine 3 milestone, so I wanted to make sure the idea didn't get lost: I just saw a beginner hit this and get confused today (so 3.0 is our chance).

Is this still a "go" (i.e. yes, something we at least can do, assuming someone does the work) for Doctrine 3?

Thanks!

Originally created by @weaverryan on GitHub (Jan 23, 2018). Hi guys! In #5874, Ocramius mentioned that the auto-escaping of column names for reserved keywords couldn't happen for Doctrine 2, but it *could* happen in Doctrine 3. I couldn't find any issue in the Doctrine 3 milestone, so I wanted to make sure the idea didn't get lost: I just saw a beginner hit this and get confused today (so 3.0 is our chance). Is this still a "go" (i.e. yes, something we at least *can* do, assuming someone does the work) for Doctrine 3? Thanks!
admin added the ImprovementBC Break labels 2026-01-22 15:19:56 +01:00
admin closed this issue 2026-01-22 15:19:58 +01:00
Author
Owner

@Ocramius commented on GitHub (Jan 23, 2018):

Yeah, I think this should happen for 3.x.

We will have bugs with people doing mixed windows/mac/linux deployments, but less problems with reserved keywords used in mappings, and we can also get rid of the awkward "quoting in mappings" syntax.

@Ocramius commented on GitHub (Jan 23, 2018): Yeah, I think this should happen for 3.x. We will have bugs with people doing mixed windows/mac/linux deployments, but less problems with reserved keywords used in mappings, and we can also get rid of the awkward "quoting in mappings" syntax.
Author
Owner

@ostrolucky commented on GitHub (Aug 7, 2018):

This already happened in master

@ostrolucky commented on GitHub (Aug 7, 2018): This already happened in master
Author
Owner

@PowerKiKi commented on GitHub (Jun 7, 2019):

This has been implemented in 08e2f779e3 (and following commits) and the issue should closed.

@PowerKiKi commented on GitHub (Jun 7, 2019): This has been implemented in 08e2f779e3881f97c8136129fe9f951a9de2cb0d (and following commits) and the issue should closed.
Author
Owner

@GregOriol commented on GitHub (Jan 17, 2025):

I'm maybe missing something but with a column definition as #[Column(type: Types::BOOLEAN, name: 'manual') and MySQL 8.4 which has "manual" as reserved keyword, an INSERT request made through the ORM fails on the word. It works by escaping it in the name definition, but shouldn't it be automatic since it belongs to the known reserved keywords?

@GregOriol commented on GitHub (Jan 17, 2025): I'm maybe missing something but with a column definition as `#[Column(type: Types::BOOLEAN, name: 'manual')` and MySQL 8.4 which has "manual" as reserved keyword, an INSERT request made through the ORM fails on the word. It works by escaping it in the name definition, but shouldn't it be automatic since it belongs to the known reserved keywords?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5852