-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Address quoteIdentifier() deprecation #11811
Conversation
We should be using quoteSingleIdentifier(), assuming we only ever pass single identifiers here. See doctrine/dbal#6590
5e5ee5d
to
aa141bf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests pass, but I'm not sure if e.g. $tableName
really is always going to be a single identifier here, and what to do if it isn't. That being said, if quoted
is set, then… maybe we should treat everything as a single identifier?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To preserve the existing behavior, table names should be split into schema name and unqualified name and quoted individually (basically, what quoteIdentifier()
would do). Even if the identifier is quoted (e.g. "inventory.products"
), AbstractAsset::_setName()
in DBAL 4 would parse it and consider inventory
to be the schema name.
I guess it's better to add or find an existing test that covers this case (e.g. create a schema in Postgres and and use a qualified table name on an entity).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After attempting what you suggested, I now believe that name
will never contain the schema part, which means such a test cannot be written.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I came to the opposite conclusion in #11812 (comment). But maybe we're talking about the same thing.
My understanding is that if the name contains a dot, the part before the dot will be considered the schema name.
In any event, quoting all values as "single identifier" looks right to me.
We should be using
quoteSingleIdentifier()
, assuming we only ever pass single identifiers here.See doctrine/dbal#6590