This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-27
Channels
- # announcements (1)
- # aws (10)
- # babashka (53)
- # calva (133)
- # clj-kondo (46)
- # cljdoc (6)
- # cljs-dev (33)
- # clojure (105)
- # clojure-boston (1)
- # clojure-europe (11)
- # clojure-nl (4)
- # clojure-poland (1)
- # clojure-switzerland (6)
- # clojure-uk (13)
- # clojurescript (106)
- # cursive (1)
- # datascript (2)
- # emacs (13)
- # events (1)
- # figwheel-main (4)
- # fulcro (17)
- # graphql (8)
- # heroku (2)
- # honeysql (8)
- # lsp (76)
- # luminus (30)
- # malli (12)
- # meander (23)
- # music (1)
- # nextjournal (83)
- # off-topic (6)
- # pathom (3)
- # polylith (19)
- # re-frame (8)
- # reagent (2)
- # reveal (3)
- # shadow-cljs (54)
- # sql (9)
- # testing (11)
- # tools-deps (15)
- # xtdb (14)
Hi! Is there a way to force (values [{:id 1, :valid true}])
to generate "... values(?,?)"
instead of "... values(?,TRUE)"
? I have been reading the docs and code but could not figure it out 🙏
That's what :lift
is for:
dev=> (sql/format (h/values [{:id 1 :value true}]))
["(id, value) VALUES (?, TRUE)" 1]
dev=> (sql/format (h/values [{:id 1 :value [:lift true]}]))
["(id, value) VALUES (?, ?)" 1 true]
dev=>
https://cljdoc.org/d/com.github.seancorfield/honeysql/2.2.858/doc/getting-started/sql-special-syntax-#liftThanks a lot! I believed I saw something like that in the docs when I first read them but when I was searching them I obviously failed to find the right search terms / look at the right place 😔
Hey hello, does anybody knows if is possible to reproduce this in honeysql?
ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address) REFERENCES addresses (address);
DDL is often very database-specific and hard to design a DSL for that works predictably so I'm open to adding support where there is ANSI-standard syntax but for a lot of DDL, it's just not worth going through HoneySQL, IMO.
Makes sense, thanks
I’m having a little trouble getting sql functions working with honeysql. Taking this example directly out of the readme:
(-> {:select [[[:max :id]]], :from [:foo]} sql/format)
["SELECT MAX(id) FROM foo"]
but instead I get an exception:Execution error (AssertionError) at honeysql.format/seq->sql (format.cljc:385).
Assert failed: Alias should have two parts[[:max :id]]