incr_id

Function incr_id 

Source
pub(super) fn incr_id<K>(
    db: &TransactionalKeyspace,
    key: K,
) -> Result<u32, AppError>
where K: Into<Slice>,
Expand description

Update the counter and return the new id. It is contiguous if every id is used.

§Examples

let new_user_id = incr_id(&DB, "users_count")?;;