You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/brick_sqlite/CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
## 4.0.1
2
+
3
+
- Fix ambiguous column in association queries with ORDER BY statements (#561)
4
+
1
5
## 4.0.0
2
6
3
7
-**BREAKING CHANGE** Require `brick_core: >= 2.0.0` and remove support for `Query(providerArgs:)`; see [migration steps](https://github.com/GetDutchie/brick/issues/510)
Copy file name to clipboardExpand all lines: packages/brick_sqlite/test/query_sql_transformer_test.dart
+28-8Lines changed: 28 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -291,6 +291,25 @@ void main() {
291
291
sqliteStatementExpectation(statement, [1]);
292
292
});
293
293
294
+
test('same field', () async {
295
+
const statement =
296
+
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` INNER JOIN `DemoModelAssoc` ON `DemoModel`.assoc_DemoModelAssoc_brick_id = `DemoModelAssoc`._brick_id WHERE `DemoModelAssoc`.id = ? AND `DemoModel`.id = ? ORDER BY `DemoModel`.id ASC';
297
+
final sqliteQuery =QuerySqlTransformer<DemoModel>(
test('compound values are expanded to column names', () async {
466
486
const statement =
467
-
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY many_assoc DESC, complex_field_name ASC';
487
+
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY many_assoc DESC, `DemoModel`.complex_field_name ASC';
468
488
final sqliteQuery =QuerySqlTransformer<DemoModel>(
469
489
modelDictionary: dictionary,
470
490
query:constQuery(
@@ -480,7 +500,7 @@ void main() {
480
500
481
501
test('fields convert to column names in providerArgs values', () async {
482
502
const statement =
483
-
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY complex_field_name ASC GROUP BY complex_field_name HAVING complex_field_name > 1000';
503
+
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY `DemoModel`.complex_field_name ASC GROUP BY `DemoModel`.complex_field_name HAVING `DemoModel`.complex_field_name > 1000';
484
504
final sqliteQuery =QuerySqlTransformer<DemoModel>(
485
505
modelDictionary: dictionary,
486
506
query:constQuery(
@@ -502,7 +522,7 @@ void main() {
502
522
503
523
test('date time is converted', () async {
504
524
const statement =
505
-
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY datetime(simple_time) DESC';
525
+
'SELECT DISTINCT `DemoModel`.* FROM `DemoModel` ORDER BY datetime(`DemoModel`.simple_time) DESC';
506
526
final sqliteQuery =QuerySqlTransformer<DemoModel>(
0 commit comments