Skip to content

Instantly share code, notes, and snippets.

@szeiger
Created November 7, 2014 08:39
Show Gist options
  • Select an option

  • Save szeiger/f0a27f639a7f617f9b3b to your computer and use it in GitHub Desktop.

Select an option

Save szeiger/f0a27f639a7f617f9b3b to your computer and use it in GitHub Desktop.
def testSimpleActionAsAction = {
class T(tag: Tag) extends Table[Int](tag, u"t") {
def a = column[Int]("a")
def * = a
}
val ts = TableQuery[T]
for {
_ <- ts.schema.create
_ <- ts ++= Seq(2, 3, 1, 5, 4)
q1 = ts.sortBy(_.a).map(_.a)
r1 <- q1.result
_ = (r1 : Seq[Int]) shouldBe List(1, 2, 3, 4, 5)
} yield ()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment