sql

agata_anastazja (she/her) 2023-05-20T09:56:31.745479Z

Hello, I want to add some timestamps to my postgres db, and using jdbc.next I saw this page https://cljdoc.org/d/seancorfield/next.jdbc/1.2.659/api/next.jdbc.date-time listing which datetime types are supported. I imagine there is a good reason why ZonedDateTime is not supported and I wonder why. Or maybe it is and it just doesn't work for me.

seancorfield 2023-05-20T17:25:29.535379Z

Because timezones are not widely supported in databases and even in PostgreSQL they can be problematic.

👍 1
seancorfield 2023-05-20T17:26:41.995309Z

For a given application, that is using PostgreSQL and no other databases, you can provide your own coercion logic easily enough based on the code in that ns.

agata_anastazja (she/her) 2023-05-21T06:35:29.723429Z

thank you!

James Amberger 2023-05-20T14:27:39.891099Z

I have (fn [& _] (get-by-id dc :HRIS/COM_EMP_ID "0613197" :fisa_refnum {})) and I can call it and it works as expected. However, if I run (map that-fn [:a]) I get:

Error printing return value (SQLRecoverableException) at oracle.jdbc.driver.PhysicalConnection/prepareStatementInternal (PhysicalConnection.java:1862).
Closed Connection 
Database is Oracle (yeah I know). Also, dc is a connection inside a (with-open)

2023-05-20T15:06:33.789419Z

Map is lazy, and you are not forcing the resulting seq until after the with-open has closed the connection

James Amberger 2023-05-20T15:15:24.573559Z

whoa

James Amberger 2023-05-20T15:15:39.269129Z

thanks for showing up, I am not sure how long it would have taken me to figure that out