Fork me on GitHub
#hugsql
<
2021-01-28
>
jeffmk23:01:26

HugSQL makes it clean to get ad-hoc fields using SELECT:

select :i*:cols from characters
where id in (:v*:ids)
But is there anything cleaner than this for ad-hoc UPDATE? https://www.hugsql.org/#using-expressions That UPDATE expression is very generic, supporting any specified table/etc. Seems like we are missing a level of abstraction here in between the two. I am looking for something more resembling the first statement if possible.

curtis.summers23:01:13

The level of abstraction you’re looking for is already available in the underlying next.jdbc or clojure.java.jdbc libraries with the update! function. So, while HugSQL lets you build any complex Clojure expression you want, you may find it easier to use the underlying library’s features.

jeffmk23:01:18

Thanks, @curtis.summers, I will check that out!