Quill v3.6-RC2 Release Notes

  • Migration Notes:

    • When working with databases which do not support boolean literals (SQL Server, Oracle, etc...) infixes representing booleans will be converted to equality-expressions.

    For example:

       query[Person].filter(p => infix"isJoe(p.name)".as[Boolean])
       // SELECT ... FROM Person p WHERE isJoe(p.name)
       // Becomes> SELECT ... FROM Person p WHERE 1 = isJoe(p.name)
    

    This is because the aforementioned databases not not directly support boolean literals (i.e. true/false) or expressions that yield them.

    In some cases however, it is desirable for the above behavior not to happen and for the whole infix statement to be treated as an expression. For example

       query[Person].filter(p => infix"${p.age} > 21".as[Boolean])
       // We Need This> SELECT ... FROM Person p WHERE p.age > 21
       // Not This> SELECT ... FROM Person p WHERE 1 = p.age > 21
    

    In order to have this behavior, instead of infix"...".as[Boolean], use infix"...".asCondition.

       query[Person].filter(p => infix"${p.age} > 21".asCondition)
       // We Need This> SELECT ... FROM Person p WHERE p.age > 21
    

    If the condition represents a pure function, be sure to use infix"...".pure.asCondition.