Slide 46
Slide 46 text
Slick: ςʔϒϧͷఆٛ: Scala
case class Entry(
id: Option[Int],ɹtitle: String, content: String)
!
object Tables {
class Entries(tag: Tag)
extends Table[Entry](tag, "entries") {
def id = column[Int]("id", O.PrimaryKey, O.AutoInc)
def title = column[String]("title")
def content = column[String]("content")
def * =
(id.?, title, content) <>
(Entry.tupled, Entry.unapply)
}
val entries = TableQuery[Entries]
}
4DBMBͱ֎քͷͰ
͘Θ͘͠ܕΛॻ͘