checkPassword static method
Checks the password of the database being open, which sqflite
returns without configuring it again when its path is already open.
Implementation
static Database checkPassword(
final Database database,
final String? password,
) {
final configuredPassword = _passwords[database];
// e.g. unknown after a hot restart
if (configuredPassword != null &&
configuredPassword != (password ?? _noPassword)) {
throw DatabaseEncryptionException(
'The database is already open with another password or without one.',
);
}
return database;
}