Support table name aliases in update and delete statements#24
Merged
damil merged 1 commit intodamil:masterfrom Jul 13, 2025
Merged
Support table name aliases in update and delete statements#24damil merged 1 commit intodamil:masterfrom
damil merged 1 commit intodamil:masterfrom
Conversation
A number of SQL databases (e.g. PostgreSQL, SQLite) support table aliases in update and delete.
Owner
|
Thanks for your contribution. I'll check what needs to be changed in DBIx::DataModel as well and then publish a new release of SQLAM. |
Contributor
Author
|
Thanks. I forgot to update the documentation. Shall I do so? |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A number of SQL databases (e.g. PostgreSQL, SQLite) support table aliases in
updateanddeletestatements. This commit adds support for this.This will allow upstream users of
SQL::Abstract::More(e.g.DBIx::Lite)to correctly support table aliases in these situations. CurrentlyDBIx::Litepasses ->table_alias($table_name, $table_alias); as the table name to thedeleteandupdatemethods, which works, fortuitously, unlessquote_charis set in which the the entire "table name" which consists of e.g,"foo" AS "alias"is turned into""foo" AS "alias""which is rejected as incorrect SQL by the DB server.