File tree Expand file tree Collapse file tree 1 file changed +0
-16
lines changed
Expand file tree Collapse file tree 1 file changed +0
-16
lines changed Original file line number Diff line number Diff line change 1- import 'dart:io' ;
2-
31import 'package:drift/drift.dart' ;
4- import 'package:drift/native.dart' ;
52import 'package:drift/remote.dart' ;
6- import 'package:path/path.dart' as path;
7- import 'package:path_provider/path_provider.dart' ;
83import 'package:sqlite3/common.dart' ;
94
105part 'database.g.dart' ;
@@ -52,21 +47,10 @@ class UriConverter extends TypeConverter<Uri, String> {
5247 @override Uri fromSql (String fromDb) => Uri .parse (fromDb);
5348}
5449
55- LazyDatabase _openConnection () {
56- return LazyDatabase (() async {
57- // TODO decide if this path is the right one to use
58- final dbFolder = await getApplicationDocumentsDirectory ();
59- final file = File (path.join (dbFolder.path, 'db.sqlite' ));
60- return NativeDatabase .createInBackground (file);
61- });
62- }
63-
6450@DriftDatabase (tables: [Accounts ])
6551class AppDatabase extends _$AppDatabase {
6652 AppDatabase (super .e);
6753
68- AppDatabase .live () : this (_openConnection ());
69-
7054 // When updating the schema:
7155 // * Make the change in the table classes, and bump schemaVersion.
7256 // * Export the new schema and generate test migrations:
You can’t perform that action at this time.
0 commit comments