Fork me on GitHub
#honeysql
<
2023-05-31
>
slipset15:05:01

Given that bar is a jsonb column and I would like to update its value to set it to the empty dictionary:

{:update :foo :set {:bar {}}}
Running this through honey/format gives:
> (honey/format {:update :foo :set {:bar {}}})
;; => ["UPDATE foo SET bar = ()"]
But this makes postgres unhappy. Clues?

slipset15:05:22

[:lift {}] works 🙂

seancorfield16:05:26

I was just about to link you to the docs about working with PG & JSON that mentions :lift 🙂