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
-
3
1
import 'package:drift/drift.dart' ;
4
- import 'package:drift/native.dart' ;
5
2
import 'package:drift/remote.dart' ;
6
- import 'package:path/path.dart' as path;
7
- import 'package:path_provider/path_provider.dart' ;
8
3
import 'package:sqlite3/common.dart' ;
9
4
10
5
part 'database.g.dart' ;
@@ -52,21 +47,10 @@ class UriConverter extends TypeConverter<Uri, String> {
52
47
@override Uri fromSql (String fromDb) => Uri .parse (fromDb);
53
48
}
54
49
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
-
64
50
@DriftDatabase (tables: [Accounts ])
65
51
class AppDatabase extends _$AppDatabase {
66
52
AppDatabase (super .e);
67
53
68
- AppDatabase .live () : this (_openConnection ());
69
-
70
54
// When updating the schema:
71
55
// * Make the change in the table classes, and bump schemaVersion.
72
56
// * Export the new schema and generate test migrations:
You can’t perform that action at this time.
0 commit comments