Skip to content

Instantly share code, notes, and snippets.

Created July 23, 2017 09:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
package com.knoldus.DAO.user.mappings
import com.knoldus.DAO.db.DBComponent
import slick.lifted.ProvenShape
case class User(id: String = "", name: String, email: String)
trait UserMapping {
this: DBComponent =>
import driver.api._
class UserMapping(tag: Tag) extends Table[User](tag, "user") {
def id: Rep[String] = column[String]("id", O.PrimaryKey)
def name: Rep[String] = column[String]("name")
def email: Rep[String] = column[String]("email", O.Unique)
def * : ProvenShape[User] = (
) <> (User.tupled, User.unapply)
val userInfo: TableQuery[UserMapping] = TableQuery[UserMapping]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment