play.api.db.slick.DatabaseConfigProvider
See theDatabaseConfigProvider companion trait
object DatabaseConfigProvider
Look up a DatabaseConfig (which is Slick type that bundles a database and profile) for the passed database name. The DatabaseConfig instance is created using the database's configuration you have provided in your application.conf, for the passed database name.
Note that if no database name is passed, default is used, and hence the configuration slick.dbs.default is used to create the DatabaseConfig instance.
==Example==
Here is an example for obtaining a DatabaseConfig instance for the database named default in your application.conf.
import play.api.Play
import play.api.db.slick.DatabaseConfigProvider
import slick.profile.RelationalProfile
val dbConfig = DatabaseConfigProvider.get[RelationalProfile](Play.current)
While here is an example for obtaining a DatabaseConfig instance for the database named orders in your application.conf.
import play.api.Play
import play.api.db.slick.DatabaseConfigProvider
import slick.profile.RelationalProfile
val dbConfig = DatabaseConfigProvider.get[RelationalProfile]("orders")(Play.current)
Attributes
- Companion
- trait
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
Members list
In this article