Fork me on GitHub

Hi Starting to understand how to use I’m not sure and would like to get some help. If I only use jdbc/query, does it close the connection once done? or do I need to close it by using with-db-connection` ?


It depends what you pass it as an argument. If you pass it a db-spec that contains an open connection, it will use it and not close it. If you pass it some other db-spec, it will create a connection from it, use it, and then close it.


Thanks @U04V70XH6 I’m/we are passing clj-postgresql.core/pool so it means it closes it, right?


If you are passing a connection pooled data source, each operation will get a connection from the pool and then "close" it, returning it to the pool.


The pool manages the actual open/close of the connections.

Jérémie Salvucci15:09:40

Hi, when I read this, I understand that if I install the library camel-snake-kebab, result-set keys should be automatically converted to kebab case if csk is in the classpath. I'm using next.jdbc version 1.2.659 and this does seem to be the case. I just perform an execute-one! with a select (as simple as possible) and I keep getting snake case keys. Did I miss something?


I think the answer is in this . > If you have on your classpath, two additional builders will be available: as-kebab-maps and as-unqualified-kebab-maps which use the ->kebab-case function from that library with as-modified-maps and as-unqualified-modified-maps respectively. This talks about builders being available, not that they are used automatically. And consider your situation. If you upgraded a library and it added camel-snake-kebab to the classpath then the results of database operations would change with no code change on your behalf. This would make it treacherous to use next.jdbc since you could not reliably predict what the column names of your own data would be

Jérémie Salvucci15:09:42

🙂 definitely true, thank you!


The blog post talks about the builders becoming "available" if CSK is on the class path -- sounds like I should make the docs clearer about how to use them, if CSK is on the class path?


An example usage would probably go a long way in this instance


Hah, I'd forgotten that next.jdbc depends on CSK itself, so those builders are always available now -- you just have to use the appropriate options and/or builders! Still, definitely needs a docs update -- and that blog post needs to be updated too I think.