Skip to content

azure_data_cosmos@0.31.0

Pre-release
Pre-release

Choose a tag to compare

@azure-sdk azure-sdk released this 26 Feb 20:11
41dd6df

0.31.0 (2026-02-25)

Features Added

  • Added with_excluded_regions to ItemOptions for additional regional routing options. (#3602)
  • Added effective_preferred_regions to the client, ensuring multi-region accounts use all regions for cross-regional availability without supplying regional preferences to their client. (#3602)
  • Added basic multi-region writes support. (#3482 and #3495)
  • Added new CosmosResponse that wraps azure_core::Response for all operations except queries. (#3622)
  • Added transactional batch support for executing multiple operations atomically within the same partition key. (#3664)
  • Added fault injection support for testing cosmosdb clients in disaster scenarios. Fault injection is behind the feature flag fault_injection. (#3599)

Breaking Changes

  • Changed our minimum supported Rust version (MSRV) from 1.85 to 1.88.
  • Removed ContainerClient::patch_item, PatchDocument, and PatchOperation temporarily to redesign the PATCH API for safe idempotency. Use a Read/Modify/Replace model with ETag-based optimistic concurrency instead.
  • Changed return type of query methods from FeedPager<T> (an alias for ItemIterator<FeedPage<T>, String>) to FeedItemIterator<T>, which implements Stream<Item = Result<T>> and provides into_pages() for page-level access. (#3515)
  • Introduced CosmosClientBuilder for constructing CosmosClient instances, replacing constructor-based API. Removed consistency_level, priority, throughput_bucket, excluded_regions, SessionRetryOptions, triggers, and IndexingDirective from options. Simplified CosmosAccountReference to take CosmosAccountEndpoint directly. Made option struct fields private with getters and with_* setters. (#3744)
  • Removed with_application_preferred_regions API. Use with_application_region to set the Azure region the app is executing in (or the closest region to the actual location you're running in); the SDK generates preferred regions by geographic proximity. (#3796)
  • Made CosmosClientBuilder::build() and DatabaseClient::container_client() async to prepare for future cache population (account, collection, partition key range caches).
  • Support for wasm32-unknown-unknown has been removed (#3377)

Other Changes

  • Added default HTTP client timeouts and added retries for connection errors. (#3752)
  • Retry policies now retry reads on all non-whitelisted status codes and retry service unavailable errors across all applicable endpoints. (#3728)