Created
July 21, 2016 06:37
-
-
Save anonymous/ea0ec05cf86cd39dad928c5a1dccd37e to your computer and use it in GitHub Desktop.
the description for this gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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