This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-01-09
Channels
- # announcements (28)
- # babashka (8)
- # bangalore-clj (1)
- # beginners (123)
- # boot (1)
- # bristol-clojurians (1)
- # calva (3)
- # cider (30)
- # clj-kondo (42)
- # cljs-dev (5)
- # clojure (260)
- # clojure-dev (11)
- # clojure-europe (7)
- # clojure-india (1)
- # clojure-italy (2)
- # clojure-losangeles (5)
- # clojure-nl (5)
- # clojure-portugal (15)
- # clojure-uk (51)
- # clojurescript (69)
- # cursive (6)
- # data-science (21)
- # datascript (17)
- # datomic (1)
- # emacs (29)
- # figwheel-main (11)
- # fulcro (89)
- # graphql (5)
- # hoplon (2)
- # hugsql (6)
- # jobs (11)
- # juxt (1)
- # leiningen (7)
- # luminus (1)
- # malli (3)
- # off-topic (64)
- # pathom (32)
- # project-updates (1)
- # re-frame (9)
- # reagent (10)
- # reitit (21)
- # ring (5)
- # ring-swagger (1)
- # shadow-cljs (8)
- # spacemacs (6)
- # xtdb (4)
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))
@curtis.summers That's it, thanks