mcpField
C
cosmos-provider

cosmos-provider

github.com/dotnetDevelopment14.8k45 installsUpdated today
Repository

About cosmos-provider

A skill for working with the Entity Framework Core provider for Azure Cosmos DB. It explains provider-specific data modeling, query and concurrency behavior, and emulator-based testing considerations.

Key features

  1. 01Non-relational query pipeline
  2. 02JSON document materialization
  3. 03Embedded owned and complex types
  4. 04Partition key configuration guidance
  5. 05ETag-based optimistic concurrency

Use cases

  1. 01Model documents for Cosmos DB
  2. 02Configure partition keys for queries
  3. 03Test with the Cosmos DB emulator

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dotnet/efcore --skill cosmos-provider

After installing, type/cosmos-providerin Claude Code to confirm it loaded.

Details

From the project README

Cosmos DB Provider

Non-relational provider with its own parallel query pipeline. Uses JSON for document materialization.

Key Differences from Relational

  • No migrations — use EnsureCreated()
  • Documents as JSON — owned and complex types become embedded objects
  • Partition key configuration required for performance
  • ETag for optimistic concurrency
  • No cross-container joins

Azure Cosmos DB Emulator for Tests

  • TestEnvironment.InitializeAsync() auto-starts a Testcontainers.CosmosDb container when Test__Cosmos__DefaultConnection is not set. Set the env var to use an existing emulator instead.
  • Skip tests requiring unsupported features on the Linux emulator with [ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))].

Comments

Markdown supported