Assign dynamically injected database name in Play Slick
问题 I have the following Play Slick DAO class. Note that the database configuration is a constant control0001 . The DAO has a function readUser that reads a user based on its user id: class UsersDAO @Inject()(@NamedDatabase("control0001") protected val dbConfigProvider: DatabaseConfigProvider) extends HasDatabaseConfigProvider[JdbcProfile] { import driver.api._ def readUser (userid: String) = { val users = TableQuery[UserDB] val action = users.filter(_.userid === userid).result val future = db