Fork me on GitHub
#sql
<
2020-04-08
>
this.rob17:04:04

Thanks @seancorfield, looks good 👍

this.rob17:04:18

I have another one for you. Although I’m not sure if it belongs here or in #pedestal

this.rob17:04:15

This bit of code runs fine on its own:

(map #(do (println "-----") %)
       (sql/find-by-keys ds
                         :activities
                         {:user_id 1}
                         {:builder-fn as-unqualified-kebab-maps}))
But when I run it in a pedestal interceptor, the println string is prepended to the output

this.rob17:04:14

I can replicate the behaviour outside of pedestal. If I bind the result and then pr-str it twice, the first one has all the println mapped values at the start of the list it prints. The second one doesn’t.

this.rob17:04:44

I’m guessing pedestal is calling pr-str or similar on it when it attaches it to the response as an EDN body

this.rob17:04:40

okay ignore me - this isn’t anything to do with next.jdbc !

user=> (pr-str (map #(do (println "xyz") %) (range 0 4)))
"(xyz\nxyz\nxyz\nxyz\n0 1 2 3)"

🙂 4
this.rob17:04:50

that teaches me for not reading the docs

kirill.salykin17:04:14

Sean, it currently to set date/time values setTimestampt used. would this work st.setObject(1, localDate)?

kirill.salykin17:04:31

i think it makes sense to delegate handling of this to db driver, rather the doing it manually? what do you think?

kirill.salykin17:04:43

happy to prepare the PR

seancorfield17:04:18

If you do not load next.jdbc.date-time then the default behavior is already setObject( idx, obj )

seancorfield17:04:42

The point of next.jdbc.date-time is to allow you to override the default setObject behavior when it doesn't do the right thing @kirill.salykin