Provides idiomatic Scala enhancements to the JDBI API.
Provides for-comprehension support for composable transactions
Provides idiomatic Scala enhancements to the JDBI API.
Provides idiomatic Scala enhancements to the JDBI API.
Examples -
dbi.open[DAO] to open a handle and attach a new sql object of the specified type to that handle
dbi.daoFor[DAO] to create a new sql object which will obtain and release connections from this dbi instance, as it needs to, and can, respectively
When in scope, you can create transactions using for comprehension. For instance -
for { handle <- dbi.transaction dao1 <- handle.attachable[Dao1] ... daoN <- handle.attachable[DaoN] } yield { dao1.some_function() ... daoN.some_other_function() }
A simple mapper that only depends on the result set
A simple mapper that only depends on the result set
Example - SimpleMapper[(String, String)](r => (r.getString("firstname"), r.getString("lastname")))
If you used with ResultSetDSL the above example can be further simplified - SimpleMapper[(String, String)](r => (r -> "firstname", r -> "lastname"))
Provides enhancements to the Dropwizard jDBI API for transactional DAOs.
Factory object for org.skife.jdbi.v2.DBI instances.
Define some implicits to allow a more concise DSL using Tuples for extracting results from an SQL result set.
Global definitions and implicits for JDBI.