I'm using slick-pg to have access to types like the Point. But after following the example on the github page usage section, I still couldn't get access types like the Point class.
Here's what I have
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]
But Point can't be found, and the suggestions intellij gives me for Timestamp is java.sql.Timestamp
I'm I doing something wrong? This have blocked me for several days now, and any help would be greatly appreciated. Thanks all