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.

544 B
Raw Blame
use anyhow::{self, Context, Result};
use aws_sdk_dynamodb::Client;
use aws_sdk_dynamodb::types::AttributeValue;
use std::collections::HashMap;

pub async fn get_metadata_by_id(
    client: &Client,
    table: &str,
    id: &str,
) -> Result<Option<HashMap<String, AttributeValue>>> {
    Ok(client
        .get_item()
        .table_name(table)
        .key("file_id", AttributeValue::S(id.to_owned()))
        .send()
        .await
        .context("failed to get item from metadata table")?
        .item()
        .map(|v| v.to_owned()))
}