Use a better representation for macros

This commit is contained in:
Eike Kettner
2021-03-02 22:14:26 +01:00
parent a48504debb
commit 71985244f1
5 changed files with 53 additions and 61 deletions

View File

@ -145,7 +145,9 @@ object ItemQueryGenerator {
}
case Expr.CustomFieldMatch(field, op, value) =>
tables.item.id.in(itemsWithCustomField(_.name ==== field)(coll, makeOp(op), value))
tables.item.id.in(
itemsWithCustomField(_.name ==== field)(coll, makeOp(op), value)
)
case Expr.CustomFieldIdMatch(field, op, value) =>
tables.item.id.in(itemsWithCustomField(_.id ==== field)(coll, makeOp(op), value))
@ -153,6 +155,9 @@ object ItemQueryGenerator {
case Expr.Fulltext(_) =>
// not supported here
Condition.unit
case _: Expr.MacroExpr =>
Condition.unit
}
private def dateToTimestamp(today: LocalDate)(date: Date): Timestamp =
@ -233,7 +238,7 @@ object ItemQueryGenerator {
}
private def itemsWithCustomField(
sel: RCustomField.Table => Condition
sel: RCustomField.Table => Condition
)(coll: Ident, op: QOp, value: String): Select = {
val cf = RCustomField.as("cf")
val cfv = RCustomFieldValue.as("cfv")