korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

No default connection pool when using defdb #382

Open chenfisher opened 7 years ago

chenfisher commented 7 years ago

The docs states that defdb creates a connection pool but from looking at the code and from testing real DB interaction using defdb it seems there's no connection pool. :make-pool is missing from the spec.

(defdb) creates a connection pool for your db spec (using the wonderful c3p0 library) to make sure resources are used efficiently. It also sets the last created pool as the default for all queries. As such, connection management is essentially taken care of for you.

Either the doc should be changed or defdb should add the :make-pool true to the spec

rpazyaquian commented 6 years ago

Should a plain defdb call assume the user wants a connection pool by default? Is leaving it out unless the user explicitly asks for it the best/most straightforward option, or should it be the default regardless?

In either case, I agree that the docs should be more explicit about this.