This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-24
Channels
- # announcements (26)
- # babashka (1)
- # beginners (174)
- # calva (1)
- # cider (10)
- # clj-kondo (27)
- # cljtogether (1)
- # clojars (8)
- # clojure (57)
- # clojure-australia (1)
- # clojure-czech (2)
- # clojure-europe (40)
- # clojure-germany (15)
- # clojure-nl (3)
- # clojure-serbia (6)
- # clojure-uk (11)
- # clojurescript (30)
- # conjure (2)
- # cursive (8)
- # datalog (16)
- # datomic (29)
- # emacs (33)
- # etaoin (1)
- # events (2)
- # fulcro (81)
- # funcool (2)
- # integrant (3)
- # jobs (2)
- # joker (2)
- # kaocha (15)
- # lsp (19)
- # malli (8)
- # membrane (1)
- # off-topic (57)
- # pathom (2)
- # reitit (10)
- # releases (1)
- # remote-jobs (2)
- # reveal (5)
- # shadow-cljs (14)
- # sql (11)
- # tools-deps (8)
- # vim (3)
Is there an option to pass somewhere in next.jdbc
to automatically convert JSONB columns from postgres, but that doesn't involve extending the result-set/ReadableColumn
protocol?
We're currently extending that protocol, but I'm wondering if there's a more functional, less protocol based method of achieving the same result of JSONB column values being converted to EDN automatically on SELECT calls
just as additional data point, I have also found the protocol way a bit clunky...plus it's global - that might be a disadvantage, depending of course on what you are doing...not a big deal anyways
Not a problem, per se, but the side-affecting nature of loading a namespace with protocol extensions has me wondering if there's a way without protocols.
Specifically, forcing everyone to have json column values parsed in the same way has me wondering about alternatives.
The functional alternative is to... have a function which wraps your query functions and parses JSONB columns, right? I'd assume that's less performant though (I might be wrong, I prefer to extend the protocol and not worry about wrapping my functions to properly (de)serialize JSON columns).
You could write a builder adapter that applied the conversion and then use default options if you wanted to make that builder your default (for a given datasource). There are caveats, and it’s probably a lot more work, but it is doable.