Accept OptionallyQualifiedName in TableEditor::setName()#6784
Merged
morozov merged 1 commit intodoctrine:4.3.xfrom Feb 17, 2025
Merged
Accept OptionallyQualifiedName in TableEditor::setName()#6784morozov merged 1 commit intodoctrine:4.3.xfrom
morozov merged 1 commit intodoctrine:4.3.xfrom
Conversation
greg0ire
approved these changes
Feb 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
TableEditorwas the first object editor introduced (#6660). Later, it was followed byUniqueConstraintEditor(#6685) andForeignKeyConstraintEditor(#6728).The API of
TableEditorwas designed to closely mimic theTableconstructor. Specifically,setName()acceptsstring. The other two were designed to provide an upgrade path to 5.0 where we eventually want to express object names asNameinstances.In order to unify the API of the editors and avoid an unnecessary BC break in the future, I want
TableEditor#setName()to also accept aName.Implementation details
In order to accommodate this API change, we need to revert the introduction of the usage of
TableEditorin all existing code, because aTablein 4.x is not guaranteed to have a valid (in terms of the SQL syntax) name. During the merge up, all those reverts will be discarded, so the 5.0.x code will keep using the editor.Additionally, I'm unmarking the
Tableconstructor as@internalfor now. Unlike theUniqueConstraintandForeignKeyConstrainteditors, the existingTableeditor hasn't fully replaced the usage of the constructor in 5.0, so expecting the end users to be able to not use the constructor is unrealistic. In its current state, it will lead to a worse user experience.