Skip to main content

insert

Function insert 

Source
pub fn insert(conn: &Connection, m: &NewMemory) -> Result<i64, AppError>
Expand description

Inserts a new row into the memories table.

§Arguments

  • conn — active SQLite connection, typically inside a transaction.
  • m — validated payload including body_hash and serialized metadata.

§Returns

The rowid assigned to the newly inserted memory.

§Errors

Returns Err(AppError::Database) on insertion failure and Err(AppError::Json) if metadata serialization fails.