Skip to content

Instantly share code, notes, and snippets.

@wfaler
Created April 15, 2014 12:57
Show Gist options
  • Select an option

  • Save wfaler/10730361 to your computer and use it in GitHub Desktop.

Select an option

Save wfaler/10730361 to your computer and use it in GitHub Desktop.
Ugly aggregation & count
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")
@gseitz
Copy link
Copy Markdown

gseitz commented Apr 15, 2014

@wfaler
Copy link
Copy Markdown
Author

wfaler commented Apr 15, 2014

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