Tag: 光滑

如何编写与数据库无关的应用程序并执行初次数据库初始化?

我正在使用Play Framework 2.1的Slick ,我有一些麻烦。 鉴于以下实体… package models import scala.slick.driver.PostgresDriver.simple._ case class Account(id: Option[Long], email: String, password: String) object Accounts extends Table[Account]("account") { def id = column[Long]("id", O.PrimaryKey, O.AutoInc) def email = column[String]("email") def password = column[String]("password") def * = id.? ~ email ~ password <> (Account, Account.unapply _) } …我必须导入一个特定的数据库驱动程序包,但我想使用H2进行testing,并在生产中使用PostgreSQL 。 我应该如何继续? 我能通过覆盖我的unit testing中的驱动程序设置来解决这个问题: package […]

斯卡拉光滑的方法到目前为止我不明白

我试图理解一些油滑的作品和它需要的东西。 这里是一个例子: package models case class Bar(id: Option[Int] = None, name: String) object Bars extends Table[Bar]("bar") { def id = column[Int]("id", O.PrimaryKey, O.AutoInc) // This is the primary key column def name = column[String]("name") // Every table needs a * projection with the same type as the table's type parameter def * = id.? ~ […]