fix: Use incremental ID

This commit is contained in:
Mahmoud Emad
2025-05-17 13:00:05 +03:00
parent bde5db0e52
commit a676854251
13 changed files with 149 additions and 116 deletions

View File

@@ -32,8 +32,9 @@ where
/// Get an object from its ID. This does not use an index lookup
fn get_by_id(&self, id: u32) -> Result<Option<V>, Error<Self::Error>>;
/// Store an item in the DB.
fn set(&self, value: &V) -> Result<(), Error<Self::Error>>;
/// Store an item in the DB and return the assigned ID.
/// This method does not modify the original model.
fn set(&self, value: &V) -> Result<u32, Error<Self::Error>>;
/// Delete all items from the db with a given index.
fn delete<I, Q>(&self, key: &Q) -> Result<(), Error<Self::Error>>