Closed MadsVETiSearch closed 3 weeks ago
changing the constructor in my db class fixed the issue.
I was using: Database() : super(connect(dbName: 'vdatabase'));
with this connect method:
DatabaseConnection connect({
required String dbName,
bool logStatements = false,
bool inMemory = false,
}) {
if (inMemory) {
driftRuntimeOptions.dontWarnAboutMultipleDatabases = true;
}
return DatabaseConnection.delayed(
Future.sync(() async {
if (inMemory) {
return DatabaseConnection(
NativeDatabase.memory(logStatements: logStatements),
);
}
final dbFolder = await getApplicationDocumentsDirectory();
final file = File(p.join(dbFolder.path, dbName));
return DatabaseConnection(
NativeDatabase.createInBackground(
file,
logStatements: logStatements,
),
);
}),
);
}
now i use: Database.defaults() : super(driftDatabase(name: 'vdatabase'));
and it works.
if you know why this was an issue, please enlighten me
Perhaps the packages were in a weird state originally where the compiler wasn't aware of the drift upgrade - that also shouldn't happen now. So it will probably keep working without using driftDatabase
, but that can't hurt :D
I just upgraded to drift version 2.20.0 from 2.13.1 ran code gen, but when i try launch the app in iOS simulator i get the following error:
Error (Xcode): packages/database/lib/src/database.g.dart:26272:13: Error: Type 'BaseReferences' not found.
the line referred to is:
Im kinda lost, i havent been able to figure out whats happening, if you need me to provide anything else, please say so