xtdb

itaied 2025-02-18T09:15:29.802399Z

can i avoid using xt-jdbc/->pg-obj?

(jdbc/execute! conn (sql/format {:insert-into :test-01
                                 :records (map xt-jdbc/->pg-obj
                                [{:_id 0
                                  :name "apple"
                                  :price 20}
                                 {:_id 1
                                  :name "banana"
                                  :price 12}])}))
how can i work with clj maps and vectors without having to convert them to pg-obj ?
(execute! conn {:insert-into :test-01
                  :records [{:_id 0
                             :name "apple"
                             :price 20}
                            {:_id 1
                             :name "banana"
                             :price 12}]})
=> 
; Execution error (PSQLException) at org.postgresql.jdbc.PgPreparedStatement/setMap (PgPreparedStatement.java:504).
; No hstore extension installed.

refset 2025-02-18T10:39:48.416079Z

hey @itai in short, you can't avoid this step unfortunately - how it works is that there's a transit+json OID type which the server knows how to handle (and in theory someone could build an extension for regular Postgres to handle similarly!)

refset 2025-02-18T10:40:49.134509Z

on the plus side though we're not implementing our own jdbc driver (well we kind of are, but it's just a wrapper, so not really) - which means the stack is really battletested

refset 2025-02-18T15:33:42.406739Z

Hey everyone, just a brief announcement that I'll be giving a talk and running some demos tomorrow at 1500 UTC - details & discussion https://discuss.xtdb.com/t/webinar-this-wednesday-19th-at-1500-utc/565 (note: not a Clojure-specific event on this occasion)

🎉 1
itaied 2025-02-19T09:17:51.656129Z

are you going to record it?

refset 2025-02-19T11:22:44.212679Z

Yes :)

👍 1
itaied 2025-02-20T09:35:16.821399Z

looking forward for the link 🙂

👌 1