Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slick {
- dbs {
- postgres {
- driver = "slick.driver.PostgresDriver$"
- db {
- profile = org.postgresql.Driver
- url = "jdbc:postgresql://localhost:5432/"${db-name}
- user = ${db-user}
- password = ${db-password}
- connectionPool = disabled
- keepAliveConnection = true
- autoCommit = false
- }
- }
- }
- }
- package database.config
- import javax.inject.{Inject, Singleton}
- import play.api.db.slick.DatabaseConfigProvider
- import play.db.NamedDatabase
- import slick.jdbc.{JdbcProfile, PostgresProfile}
- @Singleton
- final class DatabaseProvider @Inject()(@NamedDatabase("postgres") configProvider: DatabaseConfigProvider) {
- val dbConfig = configProvider.get[PostgresProfile]
- }
Add Comment
Please, Sign In to add comment