Fork me on GitHub
#sql
<
2020-12-11
>
wotbrew13:12:55

Does there exist any pair of functions to move from next.jdbc connectable's to clojure.java.jdbc maps (and vice versa) correctly in all cases? e.g in transactions and so on. I'm thinking about being able to work with functions defined against next.jdbc in a project where the entire codebase uses the old db spec format.

hiredman17:12:00

it is complicated because connectables to connection spec maps is kind of a bidirectional many to many relationship. clojure.java.jdbc accepts many different formats of connection spec maps

hiredman17:12:18

at work we have a clojure.java.jdbc setup with a connection pool that results in a connection map that is just {:datasource ....} so to pass that to next.jdbc we just (:datasource ...)

hiredman17:12:46

but we don't mix and match in one transaction