Skip to main content

upsert

Function upsert 

Source
pub async fn upsert(prefs: AdminUserPref) -> Result<AdminUserPref, Error>
Expand description

Insert or update the prefs row.

Uses umbral::orm::Manager::save which dispatches by primary key: id == 0 → INSERT, otherwise UPDATE. The caller is responsible for loading the row via fetch_or_default before mutating + persisting so the id round-trips correctly.