Closed borkdude closed 3 years ago
As discussed in Clojurians, I’ve run into the related problem of inserting into an array column; I get clojure.lang.ExceptionInfo: No reader function for tag object
as per these logs produced via this code.
So it’d be great if the pod would also support inserting vectors (or arrays, or seqables, or whatever) into a PostgreSQL array column.
Thanks!
From Slack:
4:46 PM borkdude @avi I think the insert problem will solve itself if we switch the pod format to transit which can cope with serializing arrays 4:46 PM avi:nerd_face: Makes sense, sounds promising. I’d love to help test if/when the time comes! 4:46 PM borkdude For retrieving array we still need to do something, as described here: https://github.com/seancorfield/next-jdbc/blob/develop/doc/tips-and-tricks.md#working-with-arrays
Switched to transit now on master. I'm a bit surprised that transit doesn't support serializing arrays out of the box, this is what I expected.
user=> (write-transit [1 2 3])
"[1,2,3]"
user=> (write-transit (into-array [1 2 3]))
Execution error (NullPointerException) at com.cognitect.transit.impl.AbstractEmitter/marshalTop (AbstractEmitter.java:203).
@aviflax Now supported in 0.0.3.
Behavior:
Excellent! Thank you!
See https://cljdoc.org/d/seancorfield/next.jdbc/1.0.445/doc/getting-started/tips-tricks#working-with-arrays
Workarounds:
::text