This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-12
Channels
- # babashka (22)
- # beginners (112)
- # calva (7)
- # cider (2)
- # clj-kondo (43)
- # cljdoc (25)
- # cljsrn (30)
- # clojars (16)
- # clojure (73)
- # clojure-australia (2)
- # clojure-bay-area (8)
- # clojure-europe (16)
- # clojure-finland (1)
- # clojure-italy (2)
- # clojure-nl (7)
- # clojure-uk (9)
- # clojurescript (28)
- # clojureverse-ops (2)
- # conjure (2)
- # css (22)
- # cursive (28)
- # datomic (9)
- # depstar (28)
- # emacs (6)
- # fulcro (39)
- # graalvm (61)
- # honeysql (38)
- # instaparse (3)
- # jobs (1)
- # kaocha (3)
- # malli (7)
- # pathom (83)
- # sql (3)
- # tools-deps (18)
- # vim (2)
- # xtdb (15)
I notice now that function calls are uppercased, i.e., in honey v1, [:ST_SetSRID....]
now becomes ST_SETSRID(...
when formatted in honey v2
Re: uppercase -- yeah, v1 was a bit inconsistent about that, depending on how it treated the context so you'd get lowercase for some things that were clearly built-in and "should" be uppercase, you'd get mixed case in some situations, and then you'd get uppercase for other things 😐 So I just took the position that your own "vars" (tables and column names) should be left as is (modulo the -
-> _
thing) and pretty much everything else should be uppercase.
Having to wrap things in (sql/call ..)
in v1 was probably the most common thing I got support questions and GitHub issues about: because [:foo 1 2 3]
worked in "most" situations but there were lots of edge cases where it didn't quite work and you needed to "help" HoneySQL figure it out. And that's why I went with all the other "special syntax" as plain "function" calls too: raw, inline, param, etc.
(I'm going to make coffee and feed cats but will be back to answer any Qs in 10 mins)
(back)
how does the on-conflict
, do-nothing
work (previously I was using a defhelper to default a clause)
(insert-sql {:id 1}) ;; ["INSERT INTO investigation (id) VALUES (?) ON CONFLICT DO NOTHING" 1]
(as an aside, conjure on vim recently gained the ability to put the evaluation into a comment beside the form - that's what you're seeing there - makes capturing the result of a RCF fantastic and easy to look back upon)
Nice. Yeah, I haven't documented the helpers yet -- even tho' I prefer those over working with raw data -- but, as you're finding out, they're a lot more comprehensive than in v1 (there is literally a helper now for every single clause -- and a couple of helpers for special syntax forms as well).
Once I've finished implementing all the parts of nilenso/honeysql-postgres I'll add a specific section to the docs that talks about the differences between HoneySQL v2 and that lib -- there are a few things that just made sense to do a bit differently @dharrigan
np, looking forward to it. So far, the upgrade has been relatively straightforward. The main thing for me was replacing "sql/call" and "sql/raw" statements
will do some testing over the weekend, apart from some temporal differences, the data produced v1 vs v2 should be the same
Much appreciated! I will continue working on the docs over the weekend, after completing the PG DDL stuff.
the two results are about +135,000 lines long, comprised of various sql reports, so only 2 lines differ, and that's the date of when the request to generate the reports was done 🙂
Sounds like some serious testing -- thank you!
It should now support stuff like delete from multiple tables, delete using, insert into as, and various other stuff that v1 omitted (or had only partially added).
It also has all the OVER / PARTITION BY / WINDOW stuff built in now.