Benjamin
Benjamin

Reputation: 541

Error: value <> is not a member of. Slick

i new in Scala. I going through tutorial and try to create something useful, but faced with strange error like this:

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

enter image description here

My code:

package models

import java.sql.Timestamp

import slick.jdbc.MySQLProfile._
import slick.jdbc.MySQLProfile.api.stringColumnType
import slick.jdbc.MySQLProfile.api.longColumnType
import slick.jdbc.MySQLProfile.api.timestampColumnType
import slick.lifted.Tag


case class User(id: Long, name: String, email: String, PMAccount: String)
class Users(tag: Tag) extends Table[User](tag, "Users") {
  def id = column[Long]("id")
  def name = column[String]("name")
  def email = column[String]("email")
  def PMAccount = column[String]("PMAccount")

  def * = (id, name, email, PMAccount) <> (User.tupled, User.unapply(_))

}

Can anyone help me to understand this ?

Upvotes: 2

Views: 1333

Answers (1)

ikryvorotenko
ikryvorotenko

Reputation: 1423

You have forgotten to import necessary api, just add this line to your code and it should work

import database.driver.api._

def * = (id, name, email, PMAccount) <> (User.tupled, User.unapply(_))

Upvotes: 6

Related Questions