This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-06
Channels
- # aleph (1)
- # beginners (180)
- # calva (16)
- # cider (29)
- # clj-kondo (47)
- # cljsrn (5)
- # clojure (40)
- # clojure-dev (39)
- # clojure-europe (1)
- # clojure-italy (25)
- # clojure-nl (9)
- # clojure-russia (1)
- # clojure-spec (8)
- # clojure-uk (83)
- # clojurescript (54)
- # core-async (2)
- # datomic (20)
- # defnpodcast (7)
- # figwheel (6)
- # fulcro (6)
- # jobs (5)
- # joker (4)
- # kaocha (4)
- # luminus (4)
- # off-topic (8)
- # onyx (6)
- # pathom (14)
- # re-frame (28)
- # reagent (30)
- # remote-jobs (2)
- # shadow-cljs (88)
- # spacemacs (2)
- # specter (17)
- # sql (25)
- # tools-deps (78)
- # xtdb (1)
- # yada (2)
seancorfield/next.jdbc {:mvn/version "1.0.5"}
is available -- plan
's internal "mapified" result set now implements all of IPersistentMap
so dissoc
, cons
, count
, empty
etc all work (although dissoc
and cons
will realize a full row as a hash map, just like assoc
and seq
did before).
The docs around connection pooling have also been updated.
(def sqlite {:classname "org.sqlite.JDBC"
:subprotocol "sqlite"
:subname "resources/db/component.db"})
I'm getting "No suitable driver found for <jdbc://127.0.0.1/> .." Am i missing something obvious? I've got org.xerial/sqlite-jdbc {:mvn/version "3.28.0"}
in my project and the db is at resources/db/component.db
i feel like i never know where to find an authoritative source for making the connection maps. would love to know where to look to figure this out
{:dbtype "sqlite" :dbname "resources/db/component.db"}
next.jdbc
has dropped support for the :subprotocol
/ :subname
form of db-spec because so many people get it wrong.
clojure.java.jdbc
and next.jdbc
should both work with that :dbtype
/ :dbname
version @dpsutton
As for "authoritative source", there's https://github.com/clojure/java.jdbc#example-usage and http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html#a-brief-java-jdbc-walkthrough -- where are you reading about how to use java.jdbc
@dpsutton?
yes! that's what i was looking for. i remembered something like that for the older version but didn't see it for the new next.jdbc version.
thanks so much @seancorfield
The next.jdbc
getting started docs show the :dbtype
/ :dbname
format and refer you to https://cljdoc.org/d/seancorfield/next.jdbc/1.0.5/api/next.jdbc#get-datasource for the full, mind-numbing detail on what is acceptable. Suggestions for improvements always welcome.
wow. you just get tunnel vision some times π. I also found your specs that were very helpful
@dpsutton In java.jdbc
, the docstring for get-connection
also covers this in detail -- including saying that the subprotocol/subname format is "legacy" and the dbtype/dbname format is "preferred" by the way π
I'm just kind of concerned about where folks are reading about java.jdbc
and finding the bad/outdated advice about using that legacy format?
i was just grabbing some connection maps from examples. i didn't know which drivers to use for sqlite so i found a project with it and its on the older version. and i thought i remembered the old connection map was still the same
Cool re: specs. I'll note that in java.jdbc
, instrumenting everything really slows things down. The specs in next.jdbc
seem to be a lot leaner / faster.
I'm always interested to hear of links to resources that have out of date information so I can go create issues, send PRs, or edit wikis!
(that's a soul-crushing uphill battle but, hey... at least there should never be this problem with next.jdbc
π )
@dpsutton URL? clojure-lsp
isn't turning up any java.jdbc
examples for me.