This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-20
Channels
- # adventofcode (38)
- # announcements (8)
- # aws (4)
- # babashka (131)
- # beginners (263)
- # calva (2)
- # clj-kondo (12)
- # cljdoc (12)
- # cljsrn (3)
- # clojure (122)
- # clojure-europe (3)
- # clojure-finland (2)
- # clojure-nl (13)
- # clojure-uk (80)
- # clojured (1)
- # clojuredesign-podcast (3)
- # clojurescript (78)
- # core-async (19)
- # cursive (19)
- # datomic (7)
- # duct (10)
- # events (1)
- # fulcro (7)
- # graalvm (12)
- # graphql (3)
- # juxt (4)
- # malli (10)
- # music (3)
- # nrepl (4)
- # off-topic (25)
- # pathom (4)
- # pedestal (1)
- # re-frame (78)
- # reagent (8)
- # shadow-cljs (91)
- # sql (8)
- # vim (3)
- # xtdb (2)
In next.jdbc
, since you're dealing with native Java objects (`Connection`, Statement
, etc), you can just use Java interop to set the appropriate timeout.
There's a :timeout
option that applies to prepared statements and regular statements, equivalent to the .setQueryTimeout
method on Statement
. That does mean you need to You can also call prepare
the statement first, if you want to .setQueryTimeout
on the PreparedStatement
object..setNetworkTimeout
on a Connection
object (but that requires you pass an executor as well).
That solves half of my problem, we are changing from clojure.java.jdbc to next/jdbc 🙂
@boccato Cool. I'm working on some enhancements to clojure.java.data
right now that will allow me to make it easier for next.jdbc
users to set properties on Connection
, PreparedStatement
, and other objects after construction via options.
next.jdbc
has some new features on master in case anyone wants to try them out -- next.jdbc.prepare/statement
to create a regular java.sql.Statement
more easily, which supports all the expected options, and two new options: :connection
and :statement
which take a hash map of :camelCase
property names that should be "set" on any Connection
and Statement
/`PreparedStatement` objects created:
clj -Sdeps '{:deps {seancorfield/next.jdbc
{:git/url ""
:sha "d2b898d0441ed217d8ae0bf40407d1b2e3f61060"}}}'
This makes it possible to set any options rather than just the ones that are supported directly in next.jdbc
(although these generic options will be set via Java reflection since they use java.data
under the hood).The "middleware" feature I was talking about a while back is on the back-burner for now. Or perhaps "in the hammock". It may or may not return at some future date (it's still in the test
folder tree, if you're curious).