I have case class with a lot of fields
case class H(
id: Int,
min: Option[String] = None,
max: Option[String] = None,
step: Option[String] = None,
...
)
How can I map a few field to the table?
class TH(tag: Tag) extends Table[H](tag, "H") {
def id = column[Long]("ID", O.PrimaryKey, O.AutoInc)
def min = column[Option[String]]("M")
def * = (id, min) <>(H.tupled, H.unapply)
}
when I tried like this - def * = (id, min) <>(H.tupled, H.unapply)
, instead of map all fields, got compilation exception. Can I map custom field to the table ?
BR!