twogood / kronslott-jdbi2

DropWizard+Dagger bundle to configure JDBI2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project Kronslott

Kotlin+DropWizard+Dagger JDBI2 configuration

DropWizard+Dagger bundle to setup JDBI version 2 for use in a Kotlin project.

Usage

Instructions

  1. Add Jdbi2Module as a dependency to you Dagger @Component.
  2. Make sure to @Provide DataSourceFactory and Environment from a @Module in your project.

Example

See IntegrationTest.kt for an example.

Extras

An extension function for the DBI class is provided: DBI.onDemand() without parameters. Use it like this in a Dagger @Module:

@Provides
fun provideTestDao(dbi: DBI): TestDao = dbi.onDemand()

Adding this library to your project

Follow the instructions on https://jitpack.io/#se.activout/kronslott-jdbi2.

About

DropWizard+Dagger bundle to configure JDBI2

License:MIT License


Languages

Language:Kotlin 100.0%