drift
drift copied to clipboard
initialization of DRIFT database on Windows platform
Hi, How do I open connection of sqlite database with drift on Windows platform ? Whenever I run the app, there is an error that tables do not exist. But everything is fine on mobile platform. Thanks
there is an error that tables do not exist
That sounds like the database file exists already (probably before you've first launched your drift app). Could you check whether the path you've chosen for your drift database may already be in use by another app?
I had the same issue, because I copy pasted the "connections/" folder from the example/app into my project. Fix:
Future<File> get databaseFile async {
// We use `path_provider` to find a suitable path to store our data in.
final appDir = await getApplicationDocumentsDirectory();
final dbPath = p.join(appDir.path, 'todos.db');
return File(dbPath);
}
Rename todos.db to your db name
This issue has not had any activity in over a year, closing