play-slick icon indicating copy to clipboard operation
play-slick copied to clipboard

DefaultSlickApi is unsuitable for running offline evolutions

Open asazernik opened this issue 8 years ago • 0 comments

NB: Offline evolutions are those without a running application.

Currently DefaultSlickApi has two dependencies that are hard to satisfy in a non-application context: environment: Environment and lifecycle: ApplicationLifecycle.

environment is a bogus dependency; it is unused, and should be dropped.

lifecycle implements behavior that is pretty easy to ignore if there's no lifecycle - just don't add the stop hooks. This dependency should either be made into a Option[ApplicationLifecycle] (don't know if that's doable with generic javax.inject) for both DefaultSlickApi and DatabaseConfigFactory; or, DefaultSlickApi/DatabaseConfigFactory should extend an OfflineSlickApi does the same thing but without the stop hook. In this case, the user would need some other way to initiate a shutdown.

asazernik avatar Dec 20 '17 23:12 asazernik