我正在遵循Slick 文档的指导方针,但我不明白我在这里做错了什么:
package models
import scala.slick.session.Database
import Database.threadLocalSession
import scala.slick.jdbc.{GetResult, StaticQuery => Q}
import javax.sql.DataSource
import Q.interpolation
object Data {
case class User(user: String, password: String)
lazy val db = Database.forName("default")
def result: Option[User] = {
db.withSession {
sql"SELECT user, password FROM user WHERE user = 'user' AND password = 'pass'".as[User]
}
}
}
线
sql"SELECT user, password FROM user WHERE user = 'user' AND password = 'pass'".as[User]
给我这个:
Multiple markers at this line
- could not find implicit value for parameter rconv: scala.slick.jdbc.GetResult[models.Data.User]
- could not find implicit value for parameter rconv: scala.slick.jdbc.GetResult[models.Data.User]
我在这里做错了什么?
播放框架 2.2.0、Scala 2.10.3、Slick 1.0.1