![](/img/trans.png)
[英]Storing an array of ranges of timestamps into postgresql using PlaySlick and slick-pg
[英]Can't find Types Like TimeStamp Date And Point When using Slick-pg
我正在使用slick-pg來訪問諸如Point之類的類型。 但是在遵循github頁面用法一節中的示例之后,我仍然無法獲得Point類之類的訪問類型。
這就是我所擁有的
CustomPostgresDriver.scala
package app.utils
import slick.driver.PostgresDriver
import com.github.tminglei.slickpg._
trait CustomPostgresDriver extends PostgresDriver
with PgArraySupport
with PgDateSupport
with PgRangeSupport
with PgHStoreSupport
with PgPlayJsonSupport
with PgSearchSupport
with PgPostGISSupport {
override val pgjson = "jsonb" //to keep back compatibility, pgjson's value was "json" by default
override lazy val Implicit = new ImplicitsPlus {}
override val simple = new SimpleQLPlus {}
//////
trait ImplicitsPlus extends Implicits
with ArrayImplicits
with DateTimeImplicits
with RangeImplicits
with HStoreImplicits
with JsonImplicits
with SearchImplicits
with PostGISImplicits
trait SimpleQLPlus extends SimpleQL
with ImplicitsPlus
with SearchAssistants
with PostGISAssistants
}
object CustomPostgresDriver extends CustomPostgresDriver
Users.scala
package app.models
import app.utils.CustomPostgresDriver.simple._
case class User(
id : Long,
firstName : String,
lastName : String,
phone : String,
lat : Point,
long : Point,
updatedAt : Timestamp,
createdAt : Timestamp,
)
class Users(tag: Tag) extends Table[User](tag, "USERS") {
def id = column[Long]("USER_ID", O.PrimaryKey, O.AutoInc)
def firstName = column[String]("FIRST_NAME", O.NotNull)
def lastName = column[String]("LAST_NAME", O.NotNull)
def phone = column[String]("PHONE_NUMBER", O.NotNull)
def lat = column[Point]("LATITUDE", O.NotNull)
def long = column[Point]("LONGITUDE", O.NotNull)
def updatedAt = column[Timestamp]("UPDATED_AT")
def createdAt = column[Timestamp]("CREATED_AT")
def * = (id.?, firstName, lastName, phone, lat, long, updatedAt, createdAt) <> (User.tupled, User.unapply)
}
val users = TableQuery[Users]
但是找不到Point,並且intellij給我的Timestamp建議是java.sql.Timestamp
我做錯什么了嗎? 現在已經將我封鎖了幾天,我們將不勝感激。 謝謝大家
找不到明顯的問題,請提供更多詳細信息。
但是您最好在github slick-pg
提出一個問題 ,因為我不能總是成功地訪問stackoverflow,而在我們的國家,stackoverflow通常被阻止。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.