无法在带有 3.0.0-RC1 的 TableQuery 上找到方法结果 [英] can't find method result on TableQuery with slick 3.0.0-RC1

查看:35
本文介绍了无法在带有 3.0.0-RC1 的 TableQuery 上找到方法结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试用 Slick 3.0.0-RC1,但遇到了一个奇怪的问题.

I am trying out Slick 3.0.0-RC1 and I'm running in to an odd problem.

这是我的代码:

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 我真的不明白为什么这应该失败.我在这里错过了什么吗?

Reading the docs I can't really see why this should fail. Am I missing something here?

分辨率

szeiger 指出,这可能是IntelliJ 的表示编译器"中的一个错误,这是正确的.

szeiger pointed out that this could be a bug in 'IntelliJ's presentation compiler', and that was spot on.

推荐答案

我确实遇到了同样的问题,以下是我为摆脱它所做的:

I did hit the same problem and here is what I did to get rid of it:

  1. 将 IntelliJ 更新至 14.1.3 版
  2. 使用 Scala 插件 1.5 版

我的 Scala 版本是 2.11.6

My scala version is 2.11.6

我希望这对可能遇到同样问题的人有所帮助!

I hope this helps somebody who might run into the same problem!

这篇关于无法在带有 3.0.0-RC1 的 TableQuery 上找到方法结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆