Cohesive.Adapters.Cosmos
0.1.0-alpha.80
dotnet add package Cohesive.Adapters.Cosmos --version 0.1.0-alpha.80
NuGet\Install-Package Cohesive.Adapters.Cosmos -Version 0.1.0-alpha.80
<PackageReference Include="Cohesive.Adapters.Cosmos" Version="0.1.0-alpha.80" />
<PackageVersion Include="Cohesive.Adapters.Cosmos" Version="0.1.0-alpha.80" />
<PackageReference Include="Cohesive.Adapters.Cosmos" />
paket add Cohesive.Adapters.Cosmos --version 0.1.0-alpha.80
#r "nuget: Cohesive.Adapters.Cosmos, 0.1.0-alpha.80"
#:package Cohesive.Adapters.Cosmos@0.1.0-alpha.80
#addin nuget:?package=Cohesive.Adapters.Cosmos&version=0.1.0-alpha.80&prerelease
#tool nuget:?package=Cohesive.Adapters.Cosmos&version=0.1.0-alpha.80&prerelease
Cohesive.Adapters.Cosmos
Cohesive.Adapters.Cosmos provides Azure Cosmos DB interpretations for Cohesive entity storage, Relations,
materialization sources, Process Transition receipts, domain-event inboxes, outbox records, and vector storage.
Install
dotnet add package Cohesive.Adapters.Cosmos
Build a safe Cosmos query
The standalone builder validates property paths and operators, creates deterministic parameters, and never accepts raw SQL fragments:
var id = CosmosSqlExpression.Property("c", FieldPath.FromField("Id"));
var status = CosmosSqlExpression.Property("c", FieldPath.FromField("Status"));
var template = new CosmosSqlBuilder("c")
.Select(id, "id")
.Select(status, "status")
.Where(CosmosSqlExpression.Binary(
CosmosSqlBinaryOperator.Equal,
status,
CosmosSqlExpression.RuntimeParameter("status")))
.OrderBy(id)
.OffsetLimit(offset: 0, limit: 100)
.BuildTemplate();
var statement = template.Bind(new Dictionary<string, object?>
{
["status"] = "open"
});
Use the canonical compiler when the query must retain Relation semantics, plan affinity, capability evidence, and provenance. Placement and the Cosmos storage binding remain explicit persisted interpretations of that plan.
Implemented interpretations
- Parameterized Cosmos SQL compilation for the supported canonical Relation/query slice.
- Bounded Cosmos SDK source acquisition and materialization change sources.
- Entity repository and embedded aggregate storage realization.
- Atomic Process Transition execution with exact partition-local replay receipts.
- A durable, target-deduplicating canonical domain-event inbox.
- Safe standalone Cosmos SQL construction.
- Outbox persistence and vector storage integrations.
Important boundaries
Cosmos JOIN expands arrays within one document; it is not a cross-document join. Cross-container relationships use
bounded reads and local correlation when the physical plan can preserve the requested semantics.
Process Transition receipt lookup requires exact point-read partition placement. The adapter fails with structured capability evidence when that placement cannot be resolved and never substitutes a cross-partition scan for atomic subject authority.
Missing values, null, ordering, paging, aggregation, partition scope, and continuation behavior are represented
explicitly. Unsupported combinations fail with structured diagnostics rather than inheriting SDK coercions.
Continue
- Internals contains Process Transition receipts, the domain-event inbox, full SQL builder, canonical compilation, semantic envelope, acquisition, materialization, query authority, and storage realization details.
- Relations execution and adapters explains composed PostgreSQL/Cosmos reads.
- Relations capability reference records the generated profile.
Cohesive.Storageowns the provider-neutral storage contracts.
Experimental atomic storage commits
Create CosmosStorageCommitExecutor with CreateAsync(client, databaseId, containerId, target).
It verifies a single observed writable region, /partitionKey container partitioning and disabled
TTL, then realizes conditional writes plus a receipt in one transactional batch. Other targets or
partitions are rejected; native limits include the receipt. The conservative serialized document
budget is 1 MiB. It owns a dedicated document namespace and uses a lossless stream codec independent
of the client's serializer. Recreate the executor after topology or consistency changes.
Query-dependent commits require the explicit all-writers guard protocol and a Strong account/read
profile. The local vNext emulator's Eventual profile cannot qualify these reads; it still exercises
native batch, ETag and exact receipt behavior. Run those integration checks by setting
COSMOS_STORAGE_COMMIT_CONNECTION_STRING and filtering CosmosStorageCommitTests.
See the commit decision and deferred adoption work.
For commit profiles below Strong, an item conflict or token mismatch followed by an invisible receipt
returns Unknown, including Session profiles after restart. Reconcile the exact intent when visibility
catches up; do not treat this as a definitive precondition failure. executor.Validate(intent) measures
native documents and the receipt before any I/O, using the same encoding and byte budget as execution.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Identity (>= 1.17.1)
- Cohesive.Adapters.Sql (>= 0.1.0-alpha.80)
- Cohesive.AI (>= 0.1.0-alpha.80)
- Cohesive.Processes (>= 0.1.0-alpha.80)
- Cohesive.Relations (>= 0.1.0-alpha.80)
- Cohesive.Storage (>= 0.1.0-alpha.80)
- Cohesive.Transitions (>= 0.1.0-alpha.80)
- Microsoft.Azure.Cosmos (>= 3.62.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.80 | 39 | 9/8/2026 |
| 0.1.0-alpha.79 | 52 | 9/7/2026 |
| 0.1.0-alpha.78 | 49 | 9/7/2026 |
| 0.1.0-alpha.77 | 54 | 9/7/2026 |
| 0.1.0-alpha.76 | 49 | 9/6/2026 |
| 0.1.0-alpha.75 | 52 | 9/6/2026 |
| 0.1.0-alpha.74 | 65 | 9/6/2026 |
| 0.1.0-alpha.73 | 81 | 9/5/2026 |
| 0.1.0-alpha.72 | 47 | 9/5/2026 |
| 0.1.0-alpha.71 | 50 | 9/4/2026 |
| 0.1.0-alpha.70 | 47 | 9/4/2026 |
| 0.1.0-alpha.69 | 54 | 9/2/2026 |
| 0.1.0-alpha.68 | 53 | 8/30/2026 |
| 0.1.0-alpha.67 | 78 | 8/26/2026 |
| 0.1.0-alpha.66.5 | 99 | 9/6/2026 |
| 0.1.0-alpha.66.4 | 139 | 8/30/2026 |
| 0.1.0-alpha.66.3 | 75 | 8/29/2026 |
| 0.1.0-alpha.66.2 | 63 | 8/27/2026 |
| 0.1.0-alpha.66.1 | 67 | 8/26/2026 |
| 0.1.0-alpha.66 | 87 | 8/25/2026 |