Generic interface for a provider of a DatabaseConfig instance. A DatabaseConfig is Slick type
that bundles a database and driver.
Usually, you shouldn't need to create instances of DatabaseConfigProvider explicitly. Rather, you
should rely on dependency injection. If you don't want to use dependency injection, then use the
companion object and call DatabaseConfigProvider.get.
Example
Here is an example of how you can use dependency injection to obtain an instance of DatabaseConfigProvider,
for the database named default in your **application.conf**.
class Application @Inject()(protectedval dbConfigProvider: DatabaseConfigProvider) {
// ...
}
While here is an example for injecting a DatabaseConfigProvider for a database named orders in your
**application.conf**.
Generic interface for a provider of a
DatabaseConfig
instance. ADatabaseConfig
is Slick type that bundles a database and driver.Usually, you shouldn't need to create instances of
DatabaseConfigProvider
explicitly. Rather, you should rely on dependency injection. If you don't want to use dependency injection, then use the companion object and callDatabaseConfigProvider.get
.Example
Here is an example of how you can use dependency injection to obtain an instance of
DatabaseConfigProvider
, for the database nameddefault
in your **application.conf**.While here is an example for injecting a
DatabaseConfigProvider
for a database namedorders
in your **application.conf**.