diff options
Diffstat (limited to 'src/main/scala/xyz/driver/pdsuicommon')
-rw-r--r-- | src/main/scala/xyz/driver/pdsuicommon/db/QueryBuilder.scala | 4 | ||||
-rw-r--r-- | src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/xyz/driver/pdsuicommon/db/QueryBuilder.scala b/src/main/scala/xyz/driver/pdsuicommon/db/QueryBuilder.scala index aa32166..0bf1ed6 100644 --- a/src/main/scala/xyz/driver/pdsuicommon/db/QueryBuilder.scala +++ b/src/main/scala/xyz/driver/pdsuicommon/db/QueryBuilder.scala @@ -57,10 +57,10 @@ sealed trait QueryBuilderParameters { def toSql(countQuery: Boolean, fields: Set[String], namingStrategy: NamingStrategy): (String, QueryBuilder.Binder) = { val escapedTableName = namingStrategy.table(tableData.tableName) val fieldsSql: String = if (countQuery) { - val suffix: String = (tableData.lastUpdateFieldName match { + val suffix: String = tableData.lastUpdateFieldName match { case Some(lastUpdateField) => s", max($escapedTableName.${namingStrategy.column(lastUpdateField)})" case None => "" - }) + } "count(*)" + suffix } else { if (fields == QueryBuilderParameters.AllFields) { diff --git a/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala b/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala index 8aff397..7e86eae 100644 --- a/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala +++ b/src/main/scala/xyz/driver/pdsuicommon/parsers/SearchFilterParser.scala @@ -93,8 +93,8 @@ object SearchFilterParser { private val binaryAtomParser: Parser[SearchFilterExpr.Atom.Binary] = P( dimensionParser ~ whitespaceParser ~ ( - (commonOperatorParser.! ~/ whitespaceParser ~/ AnyChar.rep(min = 1).!) - | (numericOperatorParser.! ~/ whitespaceParser ~/ numberParser.!) + (numericOperatorParser.! ~/ whitespaceParser ~/ numberParser.!) | + (commonOperatorParser.! ~/ whitespaceParser ~/ AnyChar.rep(min = 1).!) ) ~ End ).map { case BinaryAtomFromTuple(atom) => atom |