scala - Unspecified value parameters: dbConfigProvider: DatabaseConfigProvider -
in context of battling define simple plain sql dao using play , slick latest versions 2.4.x , 3.0.3 respectively. have following:
import javax.inject.inject import play.api.db.slick.{databaseconfigprovider, hasdatabaseconfigprovider} import slick.driver.jdbcprofile import slick.driver.postgresdriver.api._ import slick.lifted.tablequery import models.tables._ class basedao @inject() (protected val dbconfigprovider: databaseconfigprovider) extends hasdatabaseconfigprovider[jdbcprofile] { import driver.api._ val fundquery = tablequery[fund] } object basedao extends basedao { /// <<<<<<<<<< error here // empty }
i error unspecified value parameters: dbconfigprovider: databaseconfigprovider
on line object basedao ...
, can't find how fix syntax use-case new me , there no similar definitions in examples etc.
your class defined constructor parameter:
class basedao @inject() (protected val dbconfigprovider: databaseconfigprovider) extends hasdatabaseconfigprovider[jdbcprofile] { ... } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
so, error suggests, need provide instance of databaseconfigprovider
when building object:
val mydatabaseconfigprovider: databaseconfigprovider = ... object basedao extends basedao(mydatabaseconfigprovider) { ... }
Comments
Post a Comment