@sofra https://github.com/seancorfield/next-jdbc/commit/734c4bfada3b9242496e88ca76eaf62298764b78 -- develop branch now supports :return-generated-keys true
on execute-batch!
to attempt to return all the generated keys for each batch.
@sofra Remember that you need to close any PS you create, so use (with-open [ps (jdbc/prepare tx ...)] (prepare/execute-batch! ps ...))
"creating a connection using the PreparedStatement" -- no, calling .getConnection
on a PreparedStatement
simply returns the Connection
it was created from, i.e., tx
in your example code.
great thanks so much @seancorfield 🙏
@seancorfield thanks, I will give it a spin later today :thumbsup:
I've added a SQLite section to the Tips & Tricks page now (in docs
on develop -- will be on http://clj-doc.org with the next release) that talks about how SQLite is the only database that treats bool
and bit
as 0
or 1
values, instead of as Boolean
like every other (sane) database. The tips show how to write a builder function that does the conversion for you, as well as suggesting how to handle it in a reducing function over plan
(manually!). https://github.com/seancorfield/next-jdbc/blob/develop/doc/tips-and-tricks.md#sqlite