cat_gateway::db::event::signed_docs

Function insert_signed_docs

source
pub(crate) async fn insert_signed_docs(
    id: &Uuid,
    ver: &Uuid,
    doc_type: &Uuid,
    author: &String,
    metadata: &Option<Value>,
    payload: &Option<Value>,
    raw: &Vec<u8>,
) -> Result<()>
Expand description

Make an insert query into the event-db by adding data into the signed_docs table

  • IF the record primary key (id,ver) does not exist, then add the new record. Return success.
  • IF the record does exist, but all values are the same as stored, return Success.
  • Otherwise return an error. (Can not over-write an existing record with new data).

ยงArguments:

  • id is a UUID v7
  • ver is a UUID v7
  • doc_type is a UUID v4