Search code examples
playframeworkslickplayframework-2.2play-slick

Does the Play-Slick plugin support Slick 2.0 at all?


I was trying to get a simple Play 2.2/Slick 2.0.0-M3/Postgres 9.2 test app going, being new to Slick and only so experienced with Play. I noticed Slick's been making great progress with simplifying the API, so I prefer 2.0. However, I don't see any examples in the Play-Slick 0.5.0.8 documentation that use 2.0, and when I took a shot at it anyway, it seemed rather incompatible...

When I tried an insert:

def create = DBAction { implicit rs =>
  val users = TableQuery[Users]
  users.insert((9, "uname", "temppass", "[email protected]", 10, 11, "139132"))
  Ok("success")
}

I get this compile time error:

could not find implicit value for parameter session: scala.slick.jdbc.JdbcBackend#SessionDef

If I don't use the play-slick, I get no errors with:

def create = Action { request =>
  Database.forDataSource(DB.getDataSource()) withSession { implicit session =>
    val users = TableQuery[Users]
    users.insert((9, "uname", "temppass", "[email protected]", 10, 11, "139132"))
  }
  Ok("success")
}

Am I mistaken somehow about play-slick not supporting Slick 2.0 yet? And if not, are there any big reasons to stick with the play-slick plugin with Slick 1?


Solution

  • It has not been ported to Slick 2 yet. The reason to stick with Slick 1 is that Slick 2 has not been released :). There is an experimental milestone release out, but the stable release will take until the end of the year.