This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-05-19
Channels
- # announcements (3)
- # beginners (29)
- # biff (10)
- # calva (33)
- # cider (1)
- # clara (8)
- # clerk (10)
- # clj-kondo (6)
- # cljs-dev (5)
- # clojure (40)
- # clojure-dev (3)
- # clojure-europe (43)
- # clojure-gamedev (1)
- # clojure-nl (1)
- # clojure-norway (19)
- # clojure-uk (2)
- # clr (3)
- # cursive (12)
- # datomic (4)
- # devcards (3)
- # gratitude (3)
- # honeysql (13)
- # hoplon (25)
- # humbleui (3)
- # hyperfiddle (38)
- # malli (26)
- # pathom (38)
- # practicalli (2)
- # rdf (6)
- # reagent (8)
- # shadow-cljs (13)
- # xtdb (1)
Hi! How do I tell Honey that DEFAULT
is a Postgres keyword and not a column name that should be quoted? This
(-> (hh/update table)
(hh/set {:col :DEFAULT})
(honey.sql/format {:quoted true}))
produces UPDATE "snapshot" SET "col" = "DEFAULT"
while I need UPDATE "snapshot" SET "col" = DEFAULT
. I did not find anything in the docs other than [:raw "DEFAULT"]
. Is that it, or is there a better way? Thank you!Doesn’t that produce default()
which is a function call?
You are right. Sometimes I feel HoneySQL is too magic and beyond my understanding… 😅
Addendum to my "context-dependent" message - [...]
is also content-dependent.
E.g. :default
in a vector expands to DEFAULT
but :x
expands to x()
. So in this case it's just that HoneySQL treats :default
in a special way.
I don't want to be that guy but... https://cljdoc.org/d/com.github.seancorfield/honeysql/2.4.1026/doc/getting-started/sql-special-syntax-#constraint-default-references has examples 🙂
But, yes, the docs for :update
could certainly be beefed up...
Ah, I have been on the page but haven't thought of searching it for default 😅
Feel free to add notes to https://github.com/seancorfield/honeysql/issues/489