1

When I have 2 or more parameters - it works, but when 1 - it not compiles. Tuple is for 2 or more parameters functions, I know. But if I wan't the table with only one value?

case class Some(name: String)

class SomeTable(tag: Tag) extends Table[Some](tag, "Some") {
  def name = column[String]("SomeNAME", O.PrimaryKey)

  override def * = name <>(Some.tupled, Some.unapply)
}
Azula
  • 457
  • 2
  • 5
  • 13
  • 1
    Check [this](http://stackoverflow.com/questions/17244478/scala-projections-in-slick-for-only-one-column) out – John K May 02 '16 at 09:25
  • 1
    I am not familiar with slick but this at least compiles: `override def * = name <> (Some.apply, Some.unapply)` – Łukasz May 02 '16 at 09:29

1 Answers1

2

We can replace override by

override def * = name <>(Some.apply, Some.unapply)

It works for me.

Azula
  • 457
  • 2
  • 5
  • 13