Skip to content

Instantly share code, notes, and snippets.

Created July 21, 2016 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ea0ec05cf86cd39dad928c5a1dccd37e to your computer and use it in GitHub Desktop.
Save anonymous/ea0ec05cf86cd39dad928c5a1dccd37e to your computer and use it in GitHub Desktop.
the description for this gist
/* For Quill case class is enough */
case class User(id: Long, name: String, isActive: Boolean)
val users = quote(query[User])
/* Slick requires explicit mapping */
class Users(tag: Tag) extends Table[User](tag, "users") {
def * = (id, name, isActive) <> (User.tupled, User.unapply)
def id = column[Long]("id", O.PrimaryKey)
def name = column[String]("name", O.PrimaryKey)
def isActive = column[Boolean]("is_active", O.PrimaryKey)
}
val users = TableQuery[Users]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment