Fork me on GitHub

I have this query:

-- :name do-update-feed-title! :<!
update articles set meta = meta::jsonb - 'feed-title' ||
--~ (format "{\"feed-title\": %s}" (:title params))
where source = :source;
As you can see I'm trying a Clojure expression inside the query. But it seems that hugsql is still trying to interpret this as sql and substitute something where it shouldn't?
Parameter Mismatch: :  parameter data not found.


I need to produce something like:

update articles set meta = meta::jsonb - 'feed-title' || '{"feed-title":"Pharmaceutical Business Review - Drug Discovery"}'
where source = '';


@borkdude It might be that you need to escape that colon, since clojure expressions can return hugsql parameters to be evaluated.


Might need two, since it's in a string already:

--~ (format "{\"feed-title\"\\: %s}" (:title params))