sql

martinklepsch 2023-11-19T13:57:02.787909Z

Hey all — I'm setting up a new project with SQLite and next.jdbc and trying to port over some pragma configs from a java.jdbc setup I had before. Previously I just passed them as

:foreign_keys true
   :cache_size 10000
   :synchronous "NORMAL"
   :journal_mode "WAL"
Is there a way to achieve this with next.jdbc?

lread 2023-11-19T14:08:59.953339Z

Hiya @martinklepsch, not sure if you are aware, but I did switch cljdoc over the use next.jdbc. No guarantees I got everything right, but here's the https://github.com/cljdoc/cljdoc/commit/162e16431e379567de66fc1d339dacbded3f3a6e and the https://github.com/cljdoc/cljdoc/blob/c3a6c69aa22e805bde6a68dc0e5a1895c12b0f69/src/cljdoc/config.clj#L57-L73.

🙌 1
martinklepsch 2023-11-19T16:06:07.367499Z

Oooh, that's awesome! I wasn't aware but did check out my local cljdoc repo for that code (which seemingly hasn't been updated in a while 😀)

1
martinklepsch 2023-11-19T16:07:40.615859Z

Totally works! I'm also just noticing that I missed this section in the docs: > Any additional keys provided in the "db spec" will be passed to the JDBC driver as Properties when each connection is made. Alternatively, when used with next.jdbc.connection/->pool, additional keys correspond to setters called on the pooled connection object.

🎉 1
sheluchin 2023-11-19T17:26:53.628209Z

When using the Friendly SQL Functions, is there a way to see the raw query that's being executed?

dharrigan 2023-11-19T18:18:02.060719Z

Perhaps the with-logging might help here?

dharrigan 2023-11-19T18:18:12.543219Z

dharrigan 2023-11-19T18:19:48.905959Z

sheluchin 2023-11-19T19:17:29.093019Z

@dharrigan thanks for the pointer!

dharrigan 2023-11-19T19:59:06.756609Z

You're most welcome 🙂