mirror of
git://jb55.com/damus
synced 2024-09-19 19:46:51 +00:00
add ability to retrieve count of cached Profiles
This commit is contained in:
parent
b5ae7df795
commit
31d327a085
@ -109,4 +109,10 @@ final class ProfileDatabase {
|
||||
}
|
||||
return Profile(persisted_profile: profile)
|
||||
}
|
||||
|
||||
var count: Int {
|
||||
let request = NSFetchRequest<PersistedProfile>(entityName: entity_name)
|
||||
let count = try? persistent_container?.viewContext.count(for: request)
|
||||
return count ?? 0
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user