According to the Slick 2.0 documentation, to get the count of rows in a table:
val q1 = coffees.length
// compiles to SQL (simplified):
// select count(1) from "COFFEES"
However, it turns out that coffees.length
is of type Column[Int]
.
How does one execute the query and get the value?
run
method is not available to me (could I be missing a trait on my DB driver?)... I was, however, able to get it to run like this:scala.slick.lifted.Compiled(coffees.length).run
. If anyone knows what I'm missing to prevent the shorter version from working, let me know! – Eusebiaeusebio