diff --git a/angel_orm/CHANGELOG.md b/angel_orm/CHANGELOG.md index bfee1deb..54a6bd95 100644 --- a/angel_orm/CHANGELOG.md +++ b/angel_orm/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.0.2 +* Place `LIMIT` and `OFFSET` after `ORDER BY`. + # 2.0.1 * Apply `package:pedantic` fixes. * `@PrimaryKey()` no longer defaults to `serial`, allowing its type to be diff --git a/angel_orm/lib/src/query.dart b/angel_orm/lib/src/query.dart index 481f5702..96e38c96 100644 --- a/angel_orm/lib/src/query.dart +++ b/angel_orm/lib/src/query.dart @@ -343,12 +343,12 @@ abstract class Query extends QueryBase { var whereClause = where.compile(tableName: includeTableName ? tableName : null); if (whereClause.isNotEmpty) b.write(' WHERE $whereClause'); - if (_limit != null) b.write(' LIMIT $_limit'); - if (_offset != null) b.write(' OFFSET $_offset'); if (_groupBy != null) b.write(' GROUP BY $_groupBy'); for (var item in _orderBy) { b.write(' ORDER BY ${item.compile()}'); } + if (_limit != null) b.write(' LIMIT $_limit'); + if (_offset != null) b.write(' OFFSET $_offset'); return b.toString(); } diff --git a/angel_orm/pubspec.yaml b/angel_orm/pubspec.yaml index 8862f698..6df776a7 100644 --- a/angel_orm/pubspec.yaml +++ b/angel_orm/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_orm -version: 2.0.1 +version: 2.0.2 description: Runtime support for Angel's ORM. Includes base classes for queries. author: Tobe O homepage: https://github.com/angel-dart/orm