Skip to content

Support multiple independent unique-key constraints during container creation #312

In review

Description

Feature request

Allow container creation to express multiple independent unique-key constraints, not only one constraint containing multiple paths.

Current behavior

Both mkcon and create container accept a single unique_key string. Comma-separated paths are added to one UniqueKey instance. This supports a composite constraint, but cannot express multiple independent constraints.

Fictitious example

An ExampleShop/Products container partitioned by /tenantId needs both sku and externalCode to be independently unique within each tenant:

{
  "uniqueKeys": [
    { "paths": ["/sku"] },
    { "paths": ["/externalCode"] }
  ]
}

The existing command:

mkcon Products /tenantId /sku,/externalCode --database=ExampleShop

instead creates:

{
  "uniqueKeys": [
    { "paths": ["/sku", "/externalCode"] }
  ]
}

With that composite policy, two products in the same tenant can share a SKU when their external codes differ. This is valid composite-key behavior, but it does not satisfy the example's two independent constraints.

Expected behavior

  • Provide an unambiguous representation of the complete policy, including multiple composite constraints.
  • Support both creation commands, CLI/MCP binding, and data-plane/ARM backends.
  • Preserve existing comma-separated unique_key semantics for compatibility.
  • Validate the policy before issuing a write.
  • Respect creation-only semantics: do not silently alter or recreate existing containers.

Source evidence

Baseline: v1.3.7-preview.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions