Fix offset/limit clause for mariadb

MariaDB wants first limit and then offset (optionally), postgres
doesn't care.
This commit is contained in:
Eike Kettner 2020-06-06 11:13:33 +02:00
parent b150269528
commit d5819eab35

View File

@ -330,7 +330,7 @@ object QItem {
val frag =
query ++ fr"WHERE" ++ cond ++ order ++ (if (batch == Batch.all) Fragment.empty
else
fr"OFFSET ${batch.offset} LIMIT ${batch.limit}")
fr"LIMIT ${batch.limit} OFFSET ${batch.offset}")
logger.trace(s"List items: $frag")
frag.query[ListItem].stream
}