score:0

Accepted answer

The issue is with how you defined your table. Try changing your table definition to:

case class Task(id: Int, label: String)
object Task extends Table[Task]("TASKS") {
  lazy val database = Database.forDataSource(DB.getDataSource())
  def id = column[Int]("ID", O.PrimaryKey, O.AutoInc)
  def label = column[String]("LABEL")
  def * = id ~ label <> (Task.apply _, Task.unapply _)
  def all() : List[Task] = database.withSession { implicit db: Session =>
    Query(Task).list
  }
}

The difference is that the type param I am passing to the Table is Task instead of (Int, String). This should fix your issue.


Related Query

More Query from same tag