upsert method
- ChatItemId id,
- ChatCallCredentials credentials
Creates or updates the provided credentials
in the database.
Implementation
Future<void> upsert(ChatItemId id, ChatCallCredentials credentials) async {
_cache[id] = credentials;
await safe((db) async {
await db
.into(db.callCredentials)
.insertReturning(
credentials.toDb(id),
mode: InsertMode.insertOrReplace,
);
}, tag: 'call_credentials.upsert($id, credentials)');
_cache.remove(id);
}