sql

All things SQL and JDBC...
seancorfield 2020-07-22T20:04:49.312100Z

@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.

seancorfield 2020-07-23T14:36:47.317800Z

@sofra Remember that you need to close any PS you create, so use (with-open [ps (jdbc/prepare tx ...)] (prepare/execute-batch! ps ...))

seancorfield 2020-07-23T14:42:07.318Z

"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.

2020-07-23T23:28:23.318200Z

great thanks so much @seancorfield 🙏

2020-07-22T23:07:03.312600Z

@seancorfield thanks, I will give it a spin later today :thumbsup:

seancorfield 2020-07-22T23:44:15.315400Z

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