Cosmos: public RID addressing API (ResourceId/ResourceIdentity) (3/3)#4687
Open
simorenoh wants to merge 2 commits into
Open
Cosmos: public RID addressing API (ResourceId/ResourceIdentity) (3/3)#4687simorenoh wants to merge 2 commits into
simorenoh wants to merge 2 commits into
Conversation
Add the SDK-facing name-or-RID addressing surface to azure_data_cosmos: - New public ResourceId/ResourceIdentity types for addressing databases and containers by user name or by RID. - CosmosClient::database_client and DatabaseClient::container_client now accept impl Into<ResourceIdentity>; DatabaseClient gains name()/rid() and id() now returns &ResourceIdentity. - RID-addressed containers resolve via the driver's resolve_container_by_rid with a parent-database cross-check, and mixed name/RID addressing is rejected. - RID-addressed throughput skips the extra database read by reusing a shared resource_id() helper. - Add compile-verified emulator e2e test for RID addressing and fix breaking call sites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 3 of 3 (stacked on PR #4663) for epic #4637.
This final slice adds the SDK-facing public API in azure_data_cosmos for addressing Cosmos databases and containers by name or RID. No driver changes — it builds on the driver surface landed in slices 1 and 2.
What's added
ame()/
id(), and id() now returns &ResourceIdentity.
esolve_container_by_rid with a parent-database cross-check (CLIENT_INVALID_RESOURCE_ID when the resolved container's parent DB doesn't match the addressed database). Mixing name and RID across the DB/container hierarchy is rejected with CLIENT_MIXED_NAME_RID_ADDRESSING.
esource_id() helper).
Testing
esource_identity unit tests (run in CI).
Breaking changes
Base is targeted at simorenoh/cosmos-rid-slice2-resolution so the diff is reviewable in isolation.