-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically install PostgresPlugin in Jdbi3Builders#buildManagedJdbi when driver is Postgres #382
Comments
Since we use H2 sometimes in tests, we should also detect and install Currently only H2 and Postgres will be supported. |
For now, we will not add a way to disable this auto-add functionality. We always want it, and I would imagine most people using H2 or Postgres would want the plugin to be installed as well. |
Also, since the H2 and Postgres plugins extend |
* Add DatabaseType enum (package-private for now) * Add Jdbi3Helpers (package-private for now) * Add better documentation to top-level of Jdbi3Builders * Renamed a few local vars and parameters in Jdbi3Builders from dataSource to managedDataSource for clarity * Update Jdbi3Builders to install the H2 or Postgres JDBI plugin automatically if the database is detected as H2 or Postgres, respectively, from the JDBC database URL. * Significantly de-mock the Jdbi3BuildersTest; the only remaining mock is the Dropwizard Environment. Use an in-memory H2 database to verify the real code, and that we can actually get a connection from the built Jdbi instance. Fixes #382
* Add DatabaseType enum (package-private for now) * Add Jdbi3Helpers (package-private for now) * Add better documentation to top-level of Jdbi3Builders * Renamed a few local vars and parameters in Jdbi3Builders from dataSource to managedDataSource for clarity * Update Jdbi3Builders to install the H2 or Postgres JDBI plugin automatically if the database is detected as H2 or Postgres, respectively, from the JDBC database URL. * Significantly de-mock the Jdbi3BuildersTest; the only remaining mock is the Dropwizard Environment. Use an in-memory H2 database to verify the real code, and that we can actually get a connection from the built Jdbi instance. Fixes #382
It should first check to see if the caller passed a PostgresPlugin instance in the varargs. If it did not and the driver class is Postgres, it would be very nice for us to automatically do that.
Should there be a way to tell it not to do this automatically???
The text was updated successfully, but these errors were encountered: