I am having a problem similar to this
But I am using scala 2.11.1, slick 3.2.0, and compiling manually with SBT, not using IntelliJ.
I've defined an dntity for database:
case class ScheduleItem(id:Option[Int], cron:String, script:String, created_at:Long, updated_at:Long, created_by:String, updated_by:String)
object ScheduleItems {
class ScheduleItemsT(tag: Tag) extends Table[ScheduleItem](tag, "schedule_items") {
def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
def cron = column[String]("column")
def script = column[String]("script")
def created_at = column[Long]("created_at", SqlType("timestamp without time zone"))
def updated_at = column[Long]("updated_at", SqlType("timestamp without time zone"))
def created_by = column[String]("created_by")
def updated_by = column[String]("updated_by")
def * = (id.?, cron, script, created_at, updated_at, created_by, updated_by) <> (ScheduleItem.tupled, ScheduleItem.unapply)
}
val table = TableQuery[ScheduleItemsT]
}
I try to run a simple query to get all elements in databsae:
db.run(ScheduleItems.table.result)
When compiling, this is SBT output:
[info] Loading project definition from /home/claudino/Projetos/Testes/Agendador2_0/project
[info] Set current project to Agendador2_0 (in build file:/home/claudino/Projetos/Testes/Agendador2_0/)
[info] Compiling 3 Scala sources to /home/claudino/Projetos/Testes/Agendador2_0/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.1. Compiling...
[info] Compilation completed in 10.646 s
[error] /home/claudino/Projetos/Testes/Agendador2_0/src/main/scala/com/webradar/qns/Main.scala:13: value result is not a member of slick.lifted.TableQuery[com.webradar.Main.schedule.model.ScheduleItems.ScheduleItemsT]
[error] db.run(ScheduleItems.table.result)
[error] ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 13 s, completed 04/04/2017 11:42:20
That is, differ from slick 3.20 documentation, result is not a member of TableQuery[SomeType]. Any idea?