layout | title |
---|---|
manual |
Dynamically varying Queries |
depending on values known only at runtime.
The method inhibitWhen(b: Boolean) available on org.squeryl.Queryable[A]
is meant to be called in a from clause, it will turn a Table[A] or (sub) Query[A]
into a Queryable[Option[A]] and remove the queryable from the query
*and all expression containing this queryable.
Example :
Notice the Option[] in the result type of the query, and how the Author
table disapears from the generated SQL base on the input of inhibitWhen :