This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-11-06
Channels
- # announcements (5)
- # asami (4)
- # babashka (27)
- # beginners (1)
- # calva (4)
- # cider (64)
- # clj-kondo (7)
- # clojure (7)
- # clojure-brasil (3)
- # clojure-europe (41)
- # clojure-france (2)
- # clojure-norway (101)
- # clojure-uk (5)
- # clojurescript (19)
- # cursive (3)
- # datahike (15)
- # datomic (15)
- # events (2)
- # honeysql (11)
- # hyperfiddle (27)
- # introduce-yourself (2)
- # jobs-rus (1)
- # leiningen (8)
- # london-clojurians (1)
- # lsp (175)
- # off-topic (52)
- # overtone (10)
- # portal (15)
- # re-frame (7)
- # reagent (1)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (15)
- # sql (5)
Is there a better channel to ask honeysql questions? I want to know if I can manage to create a delete like so
delete from table where (first, second) in ((1,2), (2,1))
by just using the helpers and not having to dip into raw sql....
I know this tuple syntax works in postgres at least, not sure if its common either....This is the HoneySQL channel so you're in the right place. What have you tried? How close did you get to what you wanted?
You probably want :composite
to build those tuples.
Well I did not the :composite keyword/helper existed so this is a start, I was just using the raw syntax and was wondering if something like this existed so thanks!
(-> (delete-from :table)
(where [:in (composite :first :second)
[(composite 1 2) (composite 2 1)]])
(format))
https://cljdoc.org/d/com.github.seancorfield/honeysql/2.5.1091/api/honey.sql.helpers lists all the helpers
composite
is mentioned in https://cljdoc.org/d/com.github.seancorfield/honeysql/2.5.1091/doc/getting-started#functional-helpers and there's an example in the README too (according to that section of the Getting Started doc).
Ah yes, there's a whole section in the README about composite types https://cljdoc.org/d/com.github.seancorfield/honeysql/2.5.1091/doc/readme#composite-types
Thanks!
@seancorfield In https://github.com/seancorfield/next-jdbc/commit/3a6539f3e2704ad79a7b070c4ab13d8671adf155 you have switched from com.opentable.components/otj-pg-embedded
to io.zonky.test/embedded-postgres
, probably because the former wasn't maintained.
But seems that the former has picked up the pace.
I wonder - have you re-evaluated otj-pg-embedded
any time recently? Trying to decide which one to use in my projects.
Since zonky seemed to be continuously maintained I haven't looked at alternatives. I don't use postgresql so this is "just" a testing convenience for me.