Skip to content

Cosmos: Allow Resolving Container and Database by RID #4513

@analogrelay

Description

@analogrelay

We should allow creating a DatabaseClient and ContainerClient using RIDs instead of names. Before GA, we should consider introducing an enum like ResourceIdentity (name TBD):

#[non_exhaustive]
pub enum ResourceIdentity<'a> {
    Name(&'a str),
    Rid(&'a ResourceId),
}

Then we can change database_client and container_client APIs to take impl Into<ResourceIdentity<'_>> and implement Into<ResourceIdentity> for &str and a ResourceId newtype.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CosmosThe azure_cosmos crate
    No fields configured for Feature.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions