i developing application in scala play 2.5.4. want test database interactions, , attempting method recommended in this page.
the trouble is, unable import object play.api.db.databases. suspect may need add build.sbt file, since part of play api, i'm not sure case.
there things available, not shown in api doc
yes, need add in build.sbt
file this:
librarydependencies += jdbc
after that, reload activator , update dependencies (activator update/sbt update
).
note after need add jdbc driver of database intend use. see more info in https://www.playframework.com/documentation/2.5.x/scaladatabase
edit
as stated in comments, may cause problems slick. unfortunately classes need use provided module, if causes problems, can try 2 things:
- extract class/methods need , put them in project: can
databases
class code in https://github.com/playframework/playframework/blob/2.5.x/framework/src/play-jdbc/src/main/scala/play/api/db/databases.scala try disable dbmodule. i'm not quite sure syntax, try each 1 of those:
play.modules.enabled -= "play.api.db.dbmodule" play.modules.disabled += "play.api.db.dbmodule"
Comments
Post a Comment