With Slick, I am trying to project database table entries directly to the case class they represent. Following the example in the documentation, I set up a mapped projection usi
Personally, the partially applied apply
method from the case class does not work with my setup and Slick 3.0.
This however, works, burrowing to the proper tupled
method indirectly:
class WidgetTable(tag: Tag) extends Table[WidgetEntity](tag, "widget_tbl") {
def id = column[Int]("id",O.PrimaryKey)
def foo = column[String]("foo")
override def * = (id,foo) <> ((WidgetEntity.apply _).tupled,WidgetEntity.unapply)
}
See the full details: https://stackoverflow.com/a/38589579/564157