From 11e31cc6538bb743058e7e140520910daaf7efc3 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 20 Apr 2024 15:32:17 +0200 Subject: [PATCH 1/3] Prepare 2.17 release --- drift/CHANGELOG.md | 2 +- drift/pubspec.yaml | 2 +- drift_dev/CHANGELOG.md | 2 +- drift_dev/pubspec.yaml | 6 +++--- sqlparser/CHANGELOG.md | 2 +- sqlparser/pubspec.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drift/CHANGELOG.md b/drift/CHANGELOG.md index 90151da5..59b00974 100644 --- a/drift/CHANGELOG.md +++ b/drift/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.17.0-dev +## 2.17.0 - Adds `companion` entry to `DataClassName` to override the name of the generated companion class. diff --git a/drift/pubspec.yaml b/drift/pubspec.yaml index ba3bf91a..7d72770a 100644 --- a/drift/pubspec.yaml +++ b/drift/pubspec.yaml @@ -1,6 +1,6 @@ name: drift description: Drift is a reactive library to store relational data in Dart and Flutter applications. -version: 2.16.0 +version: 2.17.0 repository: https://github.com/simolus3/drift homepage: https://drift.simonbinder.eu/ issue_tracker: https://github.com/simolus3/drift/issues diff --git a/drift_dev/CHANGELOG.md b/drift_dev/CHANGELOG.md index 8d6b0e3b..596fc483 100644 --- a/drift_dev/CHANGELOG.md +++ b/drift_dev/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.17.0-dev +## 2.17.0 - Fix drift using the wrong import alias in generated part files. - Add the `use_sql_column_name_as_json_key` builder option. diff --git a/drift_dev/pubspec.yaml b/drift_dev/pubspec.yaml index e4d69927..bf826fe3 100644 --- a/drift_dev/pubspec.yaml +++ b/drift_dev/pubspec.yaml @@ -1,6 +1,6 @@ name: drift_dev description: Dev-dependency for users of drift. Contains the generator and development tools. -version: 2.16.0 +version: 2.17.0 repository: https://github.com/simolus3/drift homepage: https://drift.simonbinder.eu/ issue_tracker: https://github.com/simolus3/drift/issues @@ -30,9 +30,9 @@ dependencies: io: ^1.0.3 # Drift-specific analysis and apis - drift: '>=2.16.0 <2.17.0' + drift: '>=2.17.0 <2.18.0' sqlite3: '>=0.1.6 <3.0.0' - sqlparser: '^0.34.0' + sqlparser: '^0.35.0' # Dart analysis analyzer: '>=5.12.0 <7.0.0' diff --git a/sqlparser/CHANGELOG.md b/sqlparser/CHANGELOG.md index 9f9c65f0..a9596cb3 100644 --- a/sqlparser/CHANGELOG.md +++ b/sqlparser/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.35.0-dev +## 3.35.0 - Fix parsing binary literals. - Expand support for `IN` expressions, they now support tuples on the left-hand diff --git a/sqlparser/pubspec.yaml b/sqlparser/pubspec.yaml index fba7f470..271a4321 100644 --- a/sqlparser/pubspec.yaml +++ b/sqlparser/pubspec.yaml @@ -1,6 +1,6 @@ name: sqlparser description: Parses sqlite statements and performs static analysis on them -version: 0.34.1 +version: 0.35.0 homepage: https://github.com/simolus3/drift/tree/develop/sqlparser repository: https://github.com/simolus3/drift #homepage: https://drift.simonbinder.eu/ From 9bcaeddb3b2dfa18769e8ddb550968e4093fc5d0 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sat, 20 Apr 2024 15:35:17 +0200 Subject: [PATCH 2/3] Upgrade dev dependencies in drift --- drift/pubspec.yaml | 4 ++-- sqlparser/CHANGELOG.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drift/pubspec.yaml b/drift/pubspec.yaml index 7d72770a..fcbd149e 100644 --- a/drift/pubspec.yaml +++ b/drift/pubspec.yaml @@ -30,7 +30,7 @@ dev_dependencies: drift_dev: any drift_testcases: path: ../extras/integration_tests/drift_testcases - http: ^0.13.4 + http: ^1.2.1 lints: ^3.0.0 uuid: ^4.0.0 build_runner: ^2.0.0 @@ -39,4 +39,4 @@ dev_dependencies: rxdart: ^0.27.0 shelf: ^1.3.0 test_descriptor: ^2.0.1 - vm_service: ^13.0.0 + vm_service: ^14.0.0 diff --git a/sqlparser/CHANGELOG.md b/sqlparser/CHANGELOG.md index a9596cb3..b3806d76 100644 --- a/sqlparser/CHANGELOG.md +++ b/sqlparser/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.35.0 +## 0.35.0 - Fix parsing binary literals. - Expand support for `IN` expressions, they now support tuples on the left-hand From aba434e7e05f9288a5e2d3c2b73ef12921081021 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sun, 21 Apr 2024 14:51:03 +0200 Subject: [PATCH 3/3] Clarify join result types in docs --- docs/lib/snippets/dart_api/select.dart | 5 ++--- docs/pages/docs/Dart API/select.md | 4 ++-- drift/lib/src/runtime/executor/helpers/engines.dart | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/lib/snippets/dart_api/select.dart b/docs/lib/snippets/dart_api/select.dart index 937f9a09..7752f78b 100644 --- a/docs/lib/snippets/dart_api/select.dart +++ b/docs/lib/snippets/dart_api/select.dart @@ -9,6 +9,8 @@ import '../_shared/todo_tables.drift.dart'; class EntryWithCategory { EntryWithCategory(this.entry, this.category); + // The classes are generated by drift for each of the tables involved in the + // join. final TodoItem entry; final Category? category; } @@ -69,8 +71,6 @@ extension SelectExamples on CanUseCommonTables { leftOuterJoin(categories, categories.id.equalsExp(todoItems.category)), ]); - // see next section on how to parse the result - // #enddocregion joinIntro // #docregion results return query.watch().map((rows) { return rows.map((row) { @@ -81,7 +81,6 @@ extension SelectExamples on CanUseCommonTables { }).toList(); }); // #enddocregion results - // #docregion joinIntro } // #enddocregion joinIntro diff --git a/docs/pages/docs/Dart API/select.md b/docs/pages/docs/Dart API/select.md index b26f3bfe..88e308a7 100644 --- a/docs/pages/docs/Dart API/select.md +++ b/docs/pages/docs/Dart API/select.md @@ -114,14 +114,14 @@ Of course, you can also join multiple tables: {% include "blocks/snippet" snippets = snippets name = 'otherTodosInSameCategory' %} -## Parsing results +### Parsing results Calling `get()` or `watch` on a select statement with join returns a `Future` or `Stream` of `List`, respectively. Each `TypedResult` represents a row from which data can be read. It contains a `rawData` getter to obtain the raw columns. But more importantly, the `readTable` method can be used to read a data class from a table. -In the example query above, we can read the todo entry and the category from each row like this: +In the example query above, we've read the todo entry and the category from each row like this: {% include "blocks/snippet" snippets = snippets name = 'results' %} diff --git a/drift/lib/src/runtime/executor/helpers/engines.dart b/drift/lib/src/runtime/executor/helpers/engines.dart index bb488ea7..47365c4e 100644 --- a/drift/lib/src/runtime/executor/helpers/engines.dart +++ b/drift/lib/src/runtime/executor/helpers/engines.dart @@ -140,7 +140,7 @@ abstract class _TransactionExecutor extends _BaseExecutor if (_closed) { throw StateError( - "A tranaction was used after being closed. Please check that you're " + "A transaction was used after being closed. Please check that you're " 'awaiting all database operations inside a `transaction` block.'); } }