14 lines
429 B
Dart
14 lines
429 B
Dart
import 'dart:io';
|
|
|
|
import 'package:drift/drift.dart';
|
|
import 'package:drift/native.dart';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
QueryExecutor openDatabaseConnection() {
|
|
return LazyDatabase(() async {
|
|
final dir = await getApplicationDocumentsDirectory();
|
|
final file = File(p.join(dir.path, 'timetrack.db'));
|
|
return NativeDatabase.createInBackground(file);
|
|
});
|
|
}
|