Merge branch 'develop' into develop

This commit is contained in:
Moshe Dicker 2024-04-21 10:35:30 -04:00 committed by GitHub
commit 1293045b68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 16 additions and 19 deletions

View File

@ -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

View File

@ -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<TypedResult>`, 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' %}

View File

@ -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.

View File

@ -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.');
}
}

View File

@ -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
@ -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,7 +39,5 @@ dev_dependencies:
rxdart: ^0.27.0
shelf: ^1.3.0
test_descriptor: ^2.0.1
vm_service: ^13.0.0
dependency_overrides:
drift_dev:
path: ../drift_dev
vm_service: ^14.0.0

View File

@ -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.

View File

@ -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'

View File

@ -1,4 +1,4 @@
## 3.35.0-dev
## 0.35.0
- Fix parsing binary literals.
- Expand support for `IN` expressions, they now support tuples on the left-hand

View File

@ -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/