how does one update from another table for postgres? according to this https://www.postgresqltutorial.com/postgresql-update-join/ I should do update … set … from …
but when i run it in honey, i get update … from
which results in sql that won’t run against psql with ERROR: syntax error at or near "FROM"
(sql/format {:update :t1
:set {...}
:from [:t2]
:join [:t3 [:= :t2.id :t3.ref_id]]
:where [...]})
@benny Use :set0
instead of :set
.
It talks about exactly this type of update
.
well shoot, thanks @seancorfield!
(a lot of honeysql isn't currently documented at all or, at best, poorly so I wasn't sure whether it was possible until I just read over the readme!)
HoneySQL v2 will be much better documented 🙂
most of what i need is there, i just needed to look better 😉