Skip to content

UpdateAll with includes - #1360

Merged
bpamiri merged 4 commits into
developfrom
fix/issue#1273
Dec 5, 2023
Merged

UpdateAll with includes#1360
bpamiri merged 4 commits into
developfrom
fix/issue#1273

Conversation

@zainforbjs

Copy link
Copy Markdown
Contributor

Added the functionality to reference included tables in the updateAll function. Also added a testcase for it.

Added the functionality to reference included tables in the updateAll function. Also added a testcase for it.
Fixed the error for Postgre and SQL server Databases as both of these have different syntax for Update from MySQL. Take the following example which shows the same task being performed in all three databases with different syntaxes:

--MySQL
Update posts
LEFT OUTER JOIN comments ON posts.id = Comments.postid
SET averagerating = 5
WHERE Comments.postid = 1
AND posts.deletedat IS NULL

-- PostgreSQL
Update posts
SET averagerating = 5
FROM Comments
WHERE posts.id = Comments.postid
AND Comments.postid = 1
AND posts.deletedat IS NULL

--SQL Server
Update posts
SET averagerating = 5
FROM posts
LEFT OUTER JOIN comments ON posts.id = Comments.postid
WHERE Comments.postid = 1
AND posts.deletedat IS NULL
@bpamiri

bpamiri commented Dec 4, 2023

Copy link
Copy Markdown
Collaborator

@zainforbjs the H2 tests for Lucee 5 and Lucee 6 are failing. Can you take a look at this.

@zainforbjs

Copy link
Copy Markdown
Contributor Author

@zainforbjs the H2 tests for Lucee 5 and Lucee 6 are failing. Can you take a look at this.

@bpamiri We are good to go now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

updateAll() is missing JOIN statement(s) when passing a value for the include argument

2 participants