final dir = await getApplicationDocumentsDirectory();
if (dir != null) {
// make sure it exists
await dir.create(recursive: true);
// build the database path
final dbPath = join(dir.path, 'synchres.db');
// open the database
final db = await getDatabaseFactorySqflite(sqflite.databaseFactory)
.openDatabase(dbPath);
Works great on Android. However, when I try this on MacOS I am getting the following exception:
Error Domain=FMDatabase Code=26 \"file is not a database\" UserInfo={NSLocalizedDescription=file is not a database}
And the following Debug output:
2021-02-18 20:56:18.412 flutter_healthcare[27350:337697] Unknown error calling sqlite3_step (26: file is not a database) rs
2021-02-18 20:56:18.418 flutter_healthcare[27350:337697] Unknown error calling sqlite3_step (26: file is not a database) eu
2021-02-18 20:56:18.418 flutter_healthcare[27350:337697] DB Query: BEGIN EXCLUSIVE
2021-02-18 20:56:18.418 flutter_healthcare[27350:337697] Unknown error finalizing or resetting statement (26: file is not a database)
2021-02-18 20:56:18.418 flutter_healthcare[27350:337697] DB Query: BEGIN EXCLUSIVE
The dbPath has value /Users/tilo/Library/Containers/com.example.flutterHealthcare/Data/Documents/synchres.db.
Is there any recommendation specific to macOS how to calculate a proper path? Or do I have to manually create an empty DB file?
I am on the following versions:
sembast_sqflite: ^2.0.0
sqflite: ^2.0.0
sembast: ^3.0.0-nullsafety
I am using the following code to open a database:
Works great on Android. However, when I try this on MacOS I am getting the following exception:
And the following Debug output:
The dbPath has value
/Users/tilo/Library/Containers/com.example.flutterHealthcare/Data/Documents/synchres.db
.Is there any recommendation specific to macOS how to calculate a proper path? Or do I have to manually create an empty DB file?
I am on the following versions: sembast_sqflite: ^2.0.0 sqflite: ^2.0.0 sembast: ^3.0.0-nullsafety