From 18c56fe395207937376ef0d1696f9dadda8d6e43 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Mon, 19 Aug 2019 10:26:00 -0400 Subject: [PATCH] 2.0.2 --- angel_orm/CHANGELOG.md | 3 +++ angel_orm/lib/src/query.dart | 4 ++-- angel_orm/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) 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