This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-13
Channels
- # bangalore-clj (1)
- # beginners (40)
- # boot (22)
- # clara (19)
- # cljs-dev (265)
- # clojure (160)
- # clojure-dev (6)
- # clojure-italy (5)
- # clojure-russia (47)
- # clojure-spec (10)
- # clojure-uk (63)
- # clojurescript (88)
- # core-async (8)
- # cursive (54)
- # datomic (48)
- # emacs (32)
- # garden (3)
- # graphql (29)
- # hoplon (54)
- # jobs (1)
- # klipse (4)
- # luminus (5)
- # lumo (21)
- # mount (5)
- # off-topic (16)
- # om (2)
- # pedestal (10)
- # play-clj (1)
- # portkey (32)
- # re-frame (21)
- # reagent (48)
- # rum (1)
- # spacemacs (4)
- # sql (3)
- # unrepl (5)
that is a very tough one indeed @agile_geek
@thomas I can just not sign the contact yet and I very much doubt they'd pull the offer, although they want me to start Monday. I need to find out more about the other role.
can you start on Monday AND not sign the contract?
One role is Clojure but it's London and it would be one of those "you can't use that library without going thru security checks for 3 months" kind of environments (and I couldn't use my equipment or emacs etc.). The other role is probably Java and hands off anyway...but it's 3 miles away which means I could run into work if I wanted and I'd get to see my kids.
I think you should come and work in London, I miss you :)
I could start on Monday and then give notice but it looks really bad and I'd probably struggle to get contracts if I did!
just tell them you have another job in pipeline that doesnāt involve hundreds of miles of travel, worst case they pull the offer, best case you defer a week
@glenjamin probably a few more weeks yet
That's what I was thinking
That's a tough one. I think the "see my kids" part is what would sway it for me. It's one thing doing a long commute, but still getting to see your family. It's another being unable to see them for 4 nights/mornings every week. Really hard decision.
How old are you children, @agile_geek?
@yogidevbear oh, they're grown up but I still like being at home sometimes
I can understand those feelings
I think @agile_geek is talking about the project I'm on, so I'll stay out of it š
@jonpither I think I might be š
Hi Jon š Okay, guess you have to take the job now Chris š
I'd be happy to take the London role if you don't want it @agile_geek, but I don't think I'm nearly as seasoned in Clojure š
There is a compatibility library kicking around, but it uses a much earlier version of the PostgreSQL JDBC driver than I am using as a dependencyā¦
once upon a time I did, but I have forgotten everything about it, doesn't it just work?
Iām using it. It seems to just work.
It might, I am going to try throwing a map at it instead of politely turning my map into JSON and see what happensā¦
you might need to extend some protocols to make it ājust workā
now I think about it
(ājustā is a dangerous word)
something like
(extend-protocol jdbc/ISQLValue
IPersistentMap
(sql-value [value]
(doto (PGobject.)
(.setType "jsonb")
(.setValue (json/write-str value :value-fn jsonify)))))
@peterwestmacott that rings a bell
and
(extend-protocol jdbc/IResultSetReadColumn
PGobject
(result-set-read-column [pgobj metadata idx]
(let [type (.getType pgobj)
value (.getValue pgobj)]
(case type
"jsonb" (json/read-str value :key-fn keyword) ... ))))
with that technique you can provide custom serialisation/deserialisation for any object types
Also @peterwestmacott āwhereā would I make these additions?
in this case json
is [clojure.data.json :as json]
but obviously any JSON lib will do
āwhereā - in any namespace that gets loaded before you try to to read to/write from the db
OK cool, so if I have a little namespace like this:
(ns edge.sentiment.canonical-db
(:require [yesql.core :refer [defquery defqueries]]))
(def db-spec-ptmeteo
{:classname "org.postgresql.Driver"
:subprotocol "postgresql"
:subname "//localhost:5432/sentiment-canonical"
:user "oliver"})
(defqueries "sql/sentiment-queries.sql"
{:connection db-spec-ptmeteo})
that my ācoreā namespace requires in, that would be a good venue..?(oh, also jsonify
in my serialisation method is an extensible multimethod for handling random types that might be found in my Clojure maps.)
I guess so. I mean, wherever makes sense in your codebase. As long as the form has been evaluated before you try to use it, you should be fine.
They are just top level forms in a ns that gets required elsewhere.
I think there was a blog post about it somewhere that I cribbed that off. A <search engine of choice> search for the protocol names might turn up more info.
Excellent - I will consult the <search engine of choice> on the subject, as suggested
@peterwestmacott - After a couple of false starts (that were down to me being dense) I have it working - thanks again, really saved my bacon!
Ministry of Silly Walks
that is very cool indeed @yogidevbear
(-> session .getCluster .getConfiguration .getQueryOptions .getConsistencyLevel)
it's maps four levels deep, but instead of being able to see a map you have to go to the javadoc to figure out the accessor method names
oo that's much better for exploration @glenjamin