我正在尝试 Slick3.0.0-RC1
我遇到了一个奇怪的问题。
这是我的代码:
import slick.driver.SQLiteDriver.api._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Await
import scala.concurrent.duration.Duration
lazy val db = Database.forURL(
url = "jdbc:sqlite:thebase.db",
driver = "org.sqlite.JDBC"
)
case class Issue(id: Option[Int], name: String)
class IssueTable(tag: Tag) extends Table[Issue](tag, "issue"){
def id = column[Int]("issue_id", O.PrimaryKey)
def name = column[String]("name")
def * = (id.?, name) <> (Issue.tupled, Issue.unapply _)
}
val issueQuery = TableQuery[IssueTable]
Await.result(db.run(issueQuery.result), Duration.Inf) // This does not compile
错误是:
“无法解析符号结果”
正在阅读docs http://slick.typesafe.com/doc/3.0.0-RC1/gettingstarted.html我真的不明白为什么这会失败。我在这里错过了什么吗?
解决
szeiger 指出这可能是“IntelliJ 的演示编译器”中的一个错误,这一点是正确的。
我确实遇到了同样的问题,这就是我为摆脱它所做的事情:
- 将 IntelliJ 更新至版本 14.1.3
- 使用Scala插件版本1.5
我的scala版本是2.11.6
我希望这可以帮助那些可能遇到同样问题的人!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)