Files
antigravity-skills-reference/skills/azure-cosmos-rust/SKILL.md
Ares 4a5f1234bb fix: harden registry tooling, make tests hermetic, and restore metadata consistency (#168)
* chore: upgrade maintenance scripts to robust PyYAML parsing

- Replaces fragile regex frontmatter parsing with PyYAML/yaml library
- Ensures multi-line descriptions and complex characters are handled safely
- Normalizes quoting and field ordering across all maintenance scripts
- Updates validator to strictly enforce description quality

* fix: restore and refine truncated skill descriptions

- Recovered 223+ truncated descriptions from git history (6.5.0 regression)
- Refined long descriptions into concise, complete sentences (<200 chars)
- Added missing descriptions for brainstorming and orchestration skills
- Manually fixed imagen skill description
- Resolved dangling links in competitor-alternatives skill

* chore: sync generated registry files and document fixes

- Regenerated skills index with normalized forward-slash paths
- Updated README and CATALOG to reflect restored descriptions
- Documented restoration and script improvements in CHANGELOG.md

* fix: restore missing skill and align metadata for full 955 count

- Renamed SKILL.MD to SKILL.md in andruia-skill-smith to ensure indexing
- Fixed risk level and missing section in andruia-skill-smith
- Synchronized all registry files for final 955 skill count

* chore(scripts): add cross-platform runners and hermetic test orchestration

* fix(scripts): harden utf-8 output and clone target writeability

* fix(skills): add missing date metadata for strict validation

* chore(index): sync generated metadata dates

* fix(catalog): normalize skill paths to prevent CI drift

* chore: sync generated registry files

* fix: enforce LF line endings for generated registry files
2026-03-01 09:38:25 +01:00

3.2 KiB

name, description, risk, source, date_added
name description risk source date_added
azure-cosmos-rust Azure Cosmos DB SDK for Rust (NoSQL API). Use for document CRUD, queries, containers, and globally distributed data. unknown community 2026-02-27

Azure Cosmos DB SDK for Rust

Client library for Azure Cosmos DB NoSQL API — globally distributed, multi-model database.

Installation

cargo add azure_data_cosmos azure_identity

Environment Variables

COSMOS_ENDPOINT=https://<account>.documents.azure.com:443/
COSMOS_DATABASE=mydb
COSMOS_CONTAINER=mycontainer

Authentication

use azure_identity::DeveloperToolsCredential;
use azure_data_cosmos::CosmosClient;

let credential = DeveloperToolsCredential::new(None)?;
let client = CosmosClient::new(
    "https://<account>.documents.azure.com:443/",
    credential.clone(),
    None,
)?;

Client Hierarchy

Client Purpose Get From
CosmosClient Account-level operations Direct instantiation
DatabaseClient Database operations client.database_client()
ContainerClient Container/item operations database.container_client()

Core Workflow

Get Database and Container Clients

let database = client.database_client("myDatabase");
let container = database.container_client("myContainer");

Create Item

use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize)]
struct Item {
    pub id: String,
    pub partition_key: String,
    pub value: String,
}

let item = Item {
    id: "1".into(),
    partition_key: "partition1".into(),
    value: "hello".into(),
};

container.create_item("partition1", item, None).await?;

Read Item

let response = container.read_item("partition1", "1", None).await?;
let item: Item = response.into_model()?;

Replace Item

let mut item: Item = container.read_item("partition1", "1", None).await?.into_model()?;
item.value = "updated".into();

container.replace_item("partition1", "1", item, None).await?;

Patch Item

use azure_data_cosmos::models::PatchDocument;

let patch = PatchDocument::default()
    .with_add("/newField", "newValue")?
    .with_remove("/oldField")?;

container.patch_item("partition1", "1", patch, None).await?;

Delete Item

container.delete_item("partition1", "1", None).await?;

Key Auth (Optional)

Enable key-based authentication with feature flag:

cargo add azure_data_cosmos --features key_auth

Best Practices

  1. Always specify partition key — required for point reads and writes
  2. Use into_model()? — to deserialize responses into your types
  3. Derive Serialize and Deserialize — for all document types
  4. Use Entra ID auth — prefer DeveloperToolsCredential over key auth
  5. Reuse client instances — clients are thread-safe and reusable
Resource Link
API Reference https://docs.rs/azure_data_cosmos
Source Code https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/cosmos/azure_data_cosmos
crates.io https://crates.io/crates/azure_data_cosmos

When to Use

This skill is applicable to execute the workflow or actions described in the overview.