Closed hlship closed 10 years ago
Created and applied. Added bug too.
I have subsequently discovered clojure.java.jdbc/with-db-connection
and am checking that Korma honors that when no explicit DB is specified. So this may end up being more of a docstring issue, to point coders at the right function.
This was actually broken in 0.3.1 while trying to fix other bugs related to with-db
, so I consider this more as a bug.
This has been fixed in 0.3.2.
Really? That's what
with-db
does?Ok, that's useful for simple cases and interactive development.
In my situation, I have a complicated application that hits multiple databases, and the database connection details are determined properly, at runtime (based on external configuration and startup code). That means I can't use
database
with mydefentity
... it needs to come later, on eachselect
,insert
, etc.However, something like
with-db
would be great if it was thread bound. Further, it could get a single connection from the pool and re-use it across all API calls. That would simplify my code and possibly improve performance.BTW: You should add some labels so I could mark this as a "suggestion".