Closed danielcompton closed 5 months ago
See https://github.com/seancorfield/honeysql/issues/527 -- there's an example there, and the docs have been updated to refer to it (in the repo, not in a release yet). I probably need to add examples or at least cross-links from either update
or from
where it talks about values
.
Thanks! I had checked the docs for UPDATE and searched the issue tracker but wasn't really sure what to search for.
I added that example from #527 under the UPDATE
clause as well (it was already in the FROM
clause section and the :composite
special syntax section).
Postgres has a way to run multiple UPDATEs in a single statement with different SET values: https://stackoverflow.com/a/26715934, https://www.postgresql.org/docs/current/sql-update.html
I tried to replicate this in HoneySQL and got pretty close, but wanted to check:
The main thing I'm concerned about is
[[:u2 :id :email :first_name :last_name]]
. I think I'm abusing the function call syntax to make a "table call"(?). This seems like it should work fine because SQL is case insensitive, but also feels a bit wrong.