This commit is contained in:
Tobe O 2019-08-19 10:26:00 -04:00
parent 6bad589fde
commit 18c56fe395
3 changed files with 6 additions and 3 deletions

View file

@ -1,3 +1,6 @@
# 2.0.2
* Place `LIMIT` and `OFFSET` after `ORDER BY`.
# 2.0.1 # 2.0.1
* Apply `package:pedantic` fixes. * Apply `package:pedantic` fixes.
* `@PrimaryKey()` no longer defaults to `serial`, allowing its type to be * `@PrimaryKey()` no longer defaults to `serial`, allowing its type to be

View file

@ -343,12 +343,12 @@ abstract class Query<T, Where extends QueryWhere> extends QueryBase<T> {
var whereClause = var whereClause =
where.compile(tableName: includeTableName ? tableName : null); where.compile(tableName: includeTableName ? tableName : null);
if (whereClause.isNotEmpty) b.write(' WHERE $whereClause'); 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'); if (_groupBy != null) b.write(' GROUP BY $_groupBy');
for (var item in _orderBy) { for (var item in _orderBy) {
b.write(' ORDER BY ${item.compile()}'); b.write(' ORDER BY ${item.compile()}');
} }
if (_limit != null) b.write(' LIMIT $_limit');
if (_offset != null) b.write(' OFFSET $_offset');
return b.toString(); return b.toString();
} }

View file

@ -1,5 +1,5 @@
name: angel_orm name: angel_orm
version: 2.0.1 version: 2.0.2
description: Runtime support for Angel's ORM. Includes base classes for queries. description: Runtime support for Angel's ORM. Includes base classes for queries.
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/orm homepage: https://github.com/angel-dart/orm