Evaluating arbitrary expressions on the database side

The & function

Squeryl’s select clause will take any closure in parameter and evaluate it on the client side (client side as opposed to database side). Sometimes the expressions needs to be evaluated on the database side, this is what the & function does :

  • Note that the return type are equivalent in both cases, i.e. both queries resolve to Query[Float]

A select can have more than one invocation of & :