Created
April 15, 2014 12:57
-
-
Save wfaler/10730361 to your computer and use it in GitHub Desktop.
Ugly aggregation & count
This file contains hidden or 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
import scala.slick.jdbc.{GetResult, StaticQuery => Q} | |
case class FooCount(n: String, c: Int) | |
implicit val getStatusCountResult = GetResult(r => Foo(r.nextString, r.nextInt)) | |
val q = Q.queryNA[FooCount]("SELECT foo, count(foo) FROM bar GROUP BY foo") |
Thanks, this cleaned it up considerably. ..now trying to peak into the generated queries to see if they are efficient or barking mad..
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you have to do it in 2 steps: http://slick.typesafe.com/doc/2.0.1/queries.html?highlight=group#aggregation