Skip to main content

store_and_insert

Function store_and_insert 

Source
pub async fn store_and_insert<'c>(
    db: impl Acquire<'c, Database = Postgres>,
    file_store: &dyn FileStore,
    upload: NewUpload<'_>,
    contents: GenericPayload,
) -> ModelResult<Uuid>
Expand description

Stores an upload at its path, then records it like insert on a connection taken from db only then, so none is held during the upload. Deletes the stored file again if the row can’t be written.