This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-15
Channels
- # announcements (1)
- # aws (79)
- # babashka (47)
- # beginners (82)
- # calva (65)
- # cider (27)
- # cljdoc (18)
- # cljs-dev (29)
- # clojure (189)
- # clojure-dev (5)
- # clojure-europe (3)
- # clojure-italy (1)
- # clojure-madison (6)
- # clojure-nl (4)
- # clojure-spec (10)
- # clojure-uk (41)
- # clojured (3)
- # clojurescript (5)
- # clojurex (17)
- # cursive (30)
- # data-science (7)
- # datomic (17)
- # emacs (3)
- # events (6)
- # fulcro (2)
- # funcool (9)
- # graalvm (29)
- # jobs-discuss (3)
- # joker (3)
- # kaocha (6)
- # malli (5)
- # music (6)
- # off-topic (21)
- # reagent (3)
- # reitit (4)
- # rewrite-clj (8)
- # shadow-cljs (49)
- # spacemacs (7)
- # sql (23)
- # tools-deps (15)
- # vim (43)
- # xtdb (19)
That is implemented on master for 1.0.10 (whenever it gets released) https://github.com/seancorfield/next-jdbc/blob/master/doc/getting-started.md#prepared-statement-caveat
@vale Your PostgreSQL issue is also fixed now on master -- there's a new, optional namespace next.jdbc.date-time
that extends SettableParameter
to provide automatic conversion to java.sql.Timestamp
for java.util.Date
, java.time.Instant
, java.time.LocalDate
, and java.time.LocalDateTime
.
Download 1.0.10 and let me know how it goes.
I still can't believe PostgreSQL can't do that conversion on its own... I mean, I verified the failure by adding tests (that only PostgreSQL failed!).
H2 and SQLite support automatic Java Time conversion out of the box (which was a pleasant surprise). PostgreSQL doesn't (of course) but neither do Apache Derby or HSQLDB. I haven't tested MS SQL Server or MySQL for that (but I know at least MySQL supports java.util.Date
conversion!).
That'll be of interest I expect to anyone currently using Java Time types with next.jdbc
.
That means there are no more open issues for 1.0.10 so I'll release that either later tonight or some time tomorrow https://github.com/seancorfield/next-jdbc/milestone/6?closed=1
seancorfield/next.jdbc
1.0.10 is up on Clojars. On cljdoc, there's a broken link in Getting Started (to Tips & Tricks, unfortunately) that is already fixed on master.
I'll do a bigger announcement to various places later.
Thanks @seancorfield really appreciate all your hard work
@geek-draven Will that Statement
support work for you, per the example in the docs? (jdbc/execute! (.createStatement con) ["... sql goes here ..."])
@seancorfield yep, that should be perfect, I'm just about to get one of the devs to update the code they were working on to give it a go
Cool. It's 1am here and I'm heading to bed but feel free to drop thoughts/feedback in this channel and I'll catch up with it on the morrow.
@seancorfield would it be theoretically possible to make a resultset processing function that returns a raw resultset in next.jdbc ?
@nielsk I'll take a look when I'm at my desk in an hour or so.
@nielsk OK, so the problem you'll have there is that the ResultSet
object is only valid in the context of the open connection/statement from which it was retrieved -- both next.jdbc
and clojure.java.jdbc
close statements and connection after they're "done" which gives you a very limited window of opportunity to do anything useful with the ResultSet
object. My recommendation would be to use plan
and do everything you need with the results inside the reducing function you apply -- that is almost a raw ResultSet
object, just wrapped in a thin veneer of Clojure hash map behavior.
(for each row -- so you still couldn't get at the actual result set object there)
Can you explain your use case so I can suggest alternative approaches?
@seancorfield at https://github.com/seancorfield/next-jdbc/blob/master/src/next/jdbc/date_time.clj#L14 there should be Date not date .I'd send PR but am off PC
@U0522TWDA Good catch. Good job it's only a docstring! I'll fix as soon as I am at work!
Thank you for the feature BTW, now I can delete a few lines of code :)
Docstring updated on master. Thank you!
@nielsk OK, so the problem you'll have there is that the ResultSet
object is only valid in the context of the open connection/statement from which it was retrieved -- both next.jdbc
and clojure.java.jdbc
close statements and connection after they're "done" which gives you a very limited window of opportunity to do anything useful with the ResultSet
object. My recommendation would be to use plan
and do everything you need with the results inside the reducing function you apply -- that is almost a raw ResultSet
object, just wrapped in a thin veneer of Clojure hash map behavior.