Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

615 B
Raw Blame
use uuid::Uuid;

/// create record in document_email table, linking the document (an email attachment) and email message
#[tracing::instrument(skip(transaction), err)]
pub async fn create_document_email_record(
    transaction: &mut sqlx::Transaction<'_, sqlx::Postgres>,
    document_id: &str,
    email_attachment_id: Uuid,
) -> anyhow::Result<()> {
    sqlx::query!(
        r#"
            INSERT INTO "document_email" (document_id, email_attachment_id)
            VALUES ($1, $2) 
        "#,
        document_id,
        email_attachment_id,
    )
    .execute(&mut **transaction)
    .await?;

    Ok(())
}