mirror of https://github.com/AMT-Cheif/drift.git
Explain usages of .memory() in docs
This commit is contained in:
parent
0501e61f59
commit
23c912d6aa
|
@ -18,10 +18,13 @@ targets:
|
|||
options:
|
||||
generate_connect_constructor: true
|
||||
```
|
||||
|
||||
Next, re-run the build. You can now add another constructor to the generated database class:
|
||||
|
||||
```dart
|
||||
@DriftDatabase(...)
|
||||
class TodoDb extends _$TodoDb {
|
||||
// Your existing constructor, whatever it may be...
|
||||
TodoDb() : super(NativeDatabase.memory());
|
||||
|
||||
// this is the new constructor
|
||||
|
|
|
@ -24,6 +24,8 @@ part 'database.g.dart';
|
|||
include: {'tables.drift'},
|
||||
)
|
||||
class MyDb extends _$MyDb {
|
||||
// This example creates a simple in-memory database (without actual persistence).
|
||||
// To actually store data, see the database setups from other "Getting started" guides.
|
||||
MyDb() : super(NativeDatabase.memory());
|
||||
|
||||
@override
|
||||
|
|
Loading…
Reference in New Issue