1

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", "test@whatever.com", 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", "test@whatever.com", 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?

sdanzig
  • 4,510
  • 1
  • 23
  • 27

2 Answers2

3

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.

cvogt
  • 11,260
  • 30
  • 46
  • I think it might've been nice if there was something that told me "Play-slick supports up to Slick version X" ... I looked all over for that and couldn't find it. But yeah, I didn't realize that all milestones were to be considered experimental. Either way, thanks for the quick response. – sdanzig Nov 14 '13 at 21:56
  • 2
    Slick 2.0 is released as of January 21: http://slick.typesafe.com/news/2014/01/21/slick-2.0.0-released.html – Will Sargent Jan 29 '14 at 13:00
0

It doesn't seem to be officially announced, and Typesafe Activator sample is still at 1.x branch, but some closed issue means to suggest it works, and there's even a sample: https://github.com/freekh/play-slick/pull/117

juanignaciosl
  • 3,435
  • 2
  • 28
  • 28