object SlickTest extends App{
import scala.slick.driver.MySQLDriver.simple._
class NumbersTable(tag:Tag) extends Table[(Int,Int)](tag:Tag,"numbers") { def id = column[Int]("id", O.PrimaryKey, O.AutoInc) def number = column[Int]("number") def * = (id, number) }
val numbers = TableQuery[NumbersTable]
val db = Database.forURL( url="jdbc:mysql://host/db", user="?", password="?", driver="com.mysql.jdbc.Driver")
db.withSession { implicit session =>
val odds = for{ r <- numbers if r.number % 2 == 1 } yield r
println(odds.selectStatement) // select s14.`id`, s14.`number` from `numbers` s14 where false
}}val odds = numbers.withFilter{ _.number % 2 == 1 } // select s14.`id`, s14.`number` from `numbers` s14 where falseTry "==="
--
---
You received this message because you are subscribed to the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/bf4dcda0-ba21-45b9-9c12-ed436875789f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "Slick / ScalaQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scalaquery/VbpzLNjRBJQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scalaquery+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalaquery/CAGv1iyJjJp9aUA%2B6oG09iDR7AbAOQQFah2UbeHJOJHwNQHNAXw%40mail.gmail.com.