exists<T extends Model> static method
Checks if a record with id exists.
Implementation
static Future<bool> exists<T extends Model>({
required dynamic id,
Disk disk = Model.defaultDisk,
}) async {
switch (disk) {
case Disk.file:
try {
return await JsonFileModel.exists<T>(id: id);
} catch (e) {
return false;
}
case Disk.sqlite:
try {
return await SQLiteModel.exists<T>(id: id);
} catch (e) {
return false;
}
case Disk.s3:
return false;
}
}