This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-12
Channels
- # announcements (2)
- # beginners (36)
- # boot (6)
- # calva (2)
- # cider (18)
- # clj-kondo (1)
- # cljdoc (2)
- # cljs-dev (2)
- # clojure (130)
- # clojure-boston (1)
- # clojure-brasil (3)
- # clojure-czech (1)
- # clojure-europe (11)
- # clojure-italy (4)
- # clojure-losangeles (37)
- # clojure-nl (9)
- # clojure-seattle (2)
- # clojure-sweden (8)
- # clojure-uk (23)
- # clojurescript (13)
- # core-async (21)
- # cursive (13)
- # data-science (6)
- # datomic (12)
- # emacs (36)
- # figwheel-main (9)
- # fulcro (76)
- # juxt (2)
- # keechma (18)
- # leiningen (4)
- # off-topic (13)
- # pedestal (37)
- # re-frame (21)
- # reitit (2)
- # shadow-cljs (78)
- # spacemacs (23)
- # sql (13)
- # tools-deps (25)
- # uncomplicate (4)
- # unrepl (1)
- # vim (27)
Playing with next.jdbc, newbie Q, but the column names returned via queries / inserts are lowercase vs uppercase depending on the DB
@darioszr Yeah, apparently draft releases can only be seen within the org -- TIL. Here's the change log instead https://github.com/seancorfield/next-jdbc/blob/master/CHANGELOG.md (not all changes in 1.0.2 are in issues @thenonameguy)
@jonpither If you want case consistent across DBs, you'll probably need {:builder-fn rs/as-lower-maps}
but that can also cause problems with DBs that are both case-sensitive and return UPPER CASE names... RDBMS is such a hot mess of non-standard and/or inconsistent behavior 😞
Thanks I went with the unqualified keyword lower case https://github.com/juxt/crux/commit/156ded938c6032041023799aa55e9913a093e991
Thanks 🙂
Unqualified lower case was the default in clojure.java.jdbc
. If you have to work across multiple incompatible DBs, it's probably the easier option there too.
We use MySQL and it's case-sensitive in table names but not column names, so as-maps
is a change for us, but we're slowly shifting over and new code is written with next.jdbc
and that default. Where we have to interact with older code, we are trying to use as-unqualified-maps
and just ensure our code is case insensitive
(we have to be careful that table names stay as-is because of MySQL but it doesn't matter whether column names are mixed or lower case, luckily -- then we just have accessor functions for mixed case column names -- a practice we stopped some years ago, but we have a lot of legacy DB tables with mixed case!)