This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-15
Channels
- # announcements (8)
- # asami (10)
- # babashka (16)
- # beginners (86)
- # calva (22)
- # chlorine-clover (9)
- # circleci (20)
- # clj-kondo (13)
- # cljs-dev (20)
- # cljsrn (3)
- # clojure (144)
- # clojure-australia (10)
- # clojure-europe (126)
- # clojure-italy (5)
- # clojure-nl (8)
- # clojure-norway (4)
- # clojure-serbia (9)
- # clojure-uk (7)
- # clojurescript (14)
- # cursive (20)
- # data-science (1)
- # datomic (20)
- # figwheel-main (5)
- # fulcro (23)
- # graalvm (7)
- # graphql (25)
- # honeysql (15)
- # hugsql (3)
- # jobs (2)
- # lambdaisland (2)
- # leiningen (4)
- # lsp (102)
- # malli (3)
- # off-topic (51)
- # overtone (5)
- # pathom (27)
- # portal (11)
- # quil (1)
- # re-frame (19)
- # reagent (31)
- # remote-jobs (1)
- # reveal (3)
- # rewrite-clj (56)
- # shadow-cljs (45)
- # startup-in-a-month (1)
- # tools-deps (9)
Hi there is there anyone using Postgres JSONB operators with Hugsql? I am seeing this
[SELECT * FROM reports
ā WHERE image_descriptors @> '[{"image-id":"' ? '"}]'; fe4cf22c-6779-492f-b2a0-f7180c00a964]
But it does not work at the moment - original query being
-- :name report-by-image-id :? :*
SELECT * FROM reports
WHERE image_descriptors @> '[{"image-id":"' :image-id '"}]';
I think you should concatenate your strings in SQL: @> '[{"image-id":"' || :image-id || '"}]';
thanks Curtis for your answer, that makes sense I eventually went for
SELECT * FROM reports
WHERE image_descriptors @> jsonb_build_array(json_build_object('image-id', :image-id));
š 3