slick 3.2 mapped tables doesn't compile. Can't make <> work value <> is not a member of ...

62 views
Skip to first unread message

Serega Sheypak

unread,
Mar 31, 2017, 9:26:34 AM3/31/17
to Slick / ScalaQuery
Hi, here is my code:

alue <> is not a member of (slick.lifted.Rep[Long], 

What do I do wrong?

import java.util.Date

import slick.jdbc.PostgresProfile.api._

import slick.lifted.Tag
import slick.sql.SqlProfile.ColumnOption.SqlType

import slick.lifted._


case class Entity(id: Long,
name: Option[String],
owner: String,
description: String,
createdAt: Date,
updatedAt: Date)

class Entities(tag: Tag) extends Table[Entity](tag, "entity") {

def id = column[Long]("id", O.PrimaryKey, O.AutoInc)

def name = column[String]("name")

def description = column[String]("description", SqlType("varchar(1024)"))

def createdAt = column[Date]("createdAt")
def updatedAt = column[Date]("updatedAt")

def * = (id, name.?, description, createdAt, updatedAt) <> (Entity.tupled, Entity.unapply _)
}

Naftoli Gugenheim

unread,
Mar 31, 2017, 4:25:02 PM3/31/17
to Slick / ScalaQuery

Use java.sql.Timestamp instead of Date, or define a mapping for Date to Timestamp.


--

---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/dbb66b88-a942-450a-9f3c-9c7d783b5e43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Margus Sipria

unread,
Apr 7, 2017, 3:09:05 PM4/7/17
to Slick / ScalaQuery
You can get custom type mappers (example Date) for PostgreSQL from https://github.com/tminglei/slick-pg
Reply all
Reply to author
Forward
0 new messages