mirror of https://github.com/AMT-Cheif/drift.git
Merge branch 'develop' into develop
This commit is contained in:
commit
1293045b68
|
@ -9,6 +9,8 @@ import '../_shared/todo_tables.drift.dart';
|
||||||
class EntryWithCategory {
|
class EntryWithCategory {
|
||||||
EntryWithCategory(this.entry, this.category);
|
EntryWithCategory(this.entry, this.category);
|
||||||
|
|
||||||
|
// The classes are generated by drift for each of the tables involved in the
|
||||||
|
// join.
|
||||||
final TodoItem entry;
|
final TodoItem entry;
|
||||||
final Category? category;
|
final Category? category;
|
||||||
}
|
}
|
||||||
|
@ -69,8 +71,6 @@ extension SelectExamples on CanUseCommonTables {
|
||||||
leftOuterJoin(categories, categories.id.equalsExp(todoItems.category)),
|
leftOuterJoin(categories, categories.id.equalsExp(todoItems.category)),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// see next section on how to parse the result
|
|
||||||
// #enddocregion joinIntro
|
|
||||||
// #docregion results
|
// #docregion results
|
||||||
return query.watch().map((rows) {
|
return query.watch().map((rows) {
|
||||||
return rows.map((row) {
|
return rows.map((row) {
|
||||||
|
@ -81,7 +81,6 @@ extension SelectExamples on CanUseCommonTables {
|
||||||
}).toList();
|
}).toList();
|
||||||
});
|
});
|
||||||
// #enddocregion results
|
// #enddocregion results
|
||||||
// #docregion joinIntro
|
|
||||||
}
|
}
|
||||||
// #enddocregion joinIntro
|
// #enddocregion joinIntro
|
||||||
|
|
||||||
|
|
|
@ -114,14 +114,14 @@ Of course, you can also join multiple tables:
|
||||||
|
|
||||||
{% include "blocks/snippet" snippets = snippets name = 'otherTodosInSameCategory' %}
|
{% 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
|
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
|
`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
|
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.
|
`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' %}
|
{% include "blocks/snippet" snippets = snippets name = 'results' %}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## 2.17.0-dev
|
## 2.17.0
|
||||||
|
|
||||||
- Adds `companion` entry to `DataClassName` to override the name of the
|
- Adds `companion` entry to `DataClassName` to override the name of the
|
||||||
generated companion class.
|
generated companion class.
|
||||||
|
|
|
@ -140,7 +140,7 @@ abstract class _TransactionExecutor extends _BaseExecutor
|
||||||
|
|
||||||
if (_closed) {
|
if (_closed) {
|
||||||
throw StateError(
|
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.');
|
'awaiting all database operations inside a `transaction` block.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: drift
|
name: drift
|
||||||
description: Drift is a reactive library to store relational data in Dart and Flutter applications.
|
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
|
repository: https://github.com/simolus3/drift
|
||||||
homepage: https://drift.simonbinder.eu/
|
homepage: https://drift.simonbinder.eu/
|
||||||
issue_tracker: https://github.com/simolus3/drift/issues
|
issue_tracker: https://github.com/simolus3/drift/issues
|
||||||
|
@ -30,7 +30,7 @@ dev_dependencies:
|
||||||
drift_dev: any
|
drift_dev: any
|
||||||
drift_testcases:
|
drift_testcases:
|
||||||
path: ../extras/integration_tests/drift_testcases
|
path: ../extras/integration_tests/drift_testcases
|
||||||
http: ^0.13.4
|
http: ^1.2.1
|
||||||
lints: ^3.0.0
|
lints: ^3.0.0
|
||||||
uuid: ^4.0.0
|
uuid: ^4.0.0
|
||||||
build_runner: ^2.0.0
|
build_runner: ^2.0.0
|
||||||
|
@ -39,7 +39,5 @@ dev_dependencies:
|
||||||
rxdart: ^0.27.0
|
rxdart: ^0.27.0
|
||||||
shelf: ^1.3.0
|
shelf: ^1.3.0
|
||||||
test_descriptor: ^2.0.1
|
test_descriptor: ^2.0.1
|
||||||
vm_service: ^13.0.0
|
vm_service: ^14.0.0
|
||||||
dependency_overrides:
|
|
||||||
drift_dev:
|
|
||||||
path: ../drift_dev
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## 2.17.0-dev
|
## 2.17.0
|
||||||
|
|
||||||
- Fix drift using the wrong import alias in generated part files.
|
- Fix drift using the wrong import alias in generated part files.
|
||||||
- Add the `use_sql_column_name_as_json_key` builder option.
|
- Add the `use_sql_column_name_as_json_key` builder option.
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: drift_dev
|
name: drift_dev
|
||||||
description: Dev-dependency for users of drift. Contains the generator and development tools.
|
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
|
repository: https://github.com/simolus3/drift
|
||||||
homepage: https://drift.simonbinder.eu/
|
homepage: https://drift.simonbinder.eu/
|
||||||
issue_tracker: https://github.com/simolus3/drift/issues
|
issue_tracker: https://github.com/simolus3/drift/issues
|
||||||
|
@ -30,9 +30,9 @@ dependencies:
|
||||||
io: ^1.0.3
|
io: ^1.0.3
|
||||||
|
|
||||||
# Drift-specific analysis and apis
|
# 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'
|
sqlite3: '>=0.1.6 <3.0.0'
|
||||||
sqlparser: '^0.34.0'
|
sqlparser: '^0.35.0'
|
||||||
|
|
||||||
# Dart analysis
|
# Dart analysis
|
||||||
analyzer: '>=5.12.0 <7.0.0'
|
analyzer: '>=5.12.0 <7.0.0'
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
## 3.35.0-dev
|
## 0.35.0
|
||||||
|
|
||||||
- Fix parsing binary literals.
|
- Fix parsing binary literals.
|
||||||
- Expand support for `IN` expressions, they now support tuples on the left-hand
|
- Expand support for `IN` expressions, they now support tuples on the left-hand
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: sqlparser
|
name: sqlparser
|
||||||
description: Parses sqlite statements and performs static analysis on them
|
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
|
homepage: https://github.com/simolus3/drift/tree/develop/sqlparser
|
||||||
repository: https://github.com/simolus3/drift
|
repository: https://github.com/simolus3/drift
|
||||||
#homepage: https://drift.simonbinder.eu/
|
#homepage: https://drift.simonbinder.eu/
|
||||||
|
|
Loading…
Reference in New Issue