azure_data_cosmos@0.37.0
Pre-release
Pre-release
0.37.0 (2026-07-20)
Features Added
- Added runtime diagnostics output configuration via
CosmosRuntimeBuilder::with_diagnostics_options, including the env-backedAZURE_COSMOS_DIAGNOSTICS_DEFAULT_VERBOSITYoption. The built-in default is now summary diagnostics JSON. (#4733) - Gateway 2.0 transport (a regional proxy forwarding RNTBD-over-HTTP/2) is selected automatically when the account advertises thin-client endpoints, the connectivity probe confirms them, and the runtime has not opted out. (#4319, #4803)
- Added the re-exported
ConnectionPoolOptions::gateway_v2_disabledandConnectionPoolOptionsBuilder::with_gateway_v2_disabled, withAZURE_COSMOS_CONNECTION_POOL_GATEWAY_V2_DISABLEDconfiguration and an environment-only_OVERRIDEincident switch. (#4763) - HTTP 449 (RetryWith) responses are now retried transparently in-region with exponential backoff, so callers no longer see spurious 449 errors from concurrent writes. (#4319)
ReadConsistencyStrategyis now honored across Gateway V1 and V2 reads. Adds theLatestCommittedvariant (a quorum read independent of the account default);GlobalStrongis rejected withBadRequestunless the account default isStrong. Per-request strategy overrides the client default. (#4319)- Added preview distributed transaction SDK builders, patch operations, diagnostics, and response accessors behind the disabled-by-default
preview_dtxfeature. (#4702) - Added change feed pull support via
ContainerClient::query_change_feed(), which takes a requiredChangeFeedStartFromstart position (Beginning,Now,PointInTime) and returns aChangeFeedPageIterator<T>that streamsFeedPage<T>results. NewfeedtypesChangeFeedPageIterator,FeedScope, andContinuationToken, plusoptionstypesChangeFeedOptionsandChangeFeedMode(currentlyLatestVersion); supports single-partition, per-partition-key, and full-container (cross-partition fan-out) reads with continuation-token resumption that persists the original start position so never-polled partitions don't replay history on resume. (#4621) - Change feed items are now surfaced as an envelope.
ContainerClient::query_change_feed::<YourDoc>()yieldsChangeFeedItem<YourDoc>, binding the envelope into the return type so the post-change document is read viaChangeFeedItem::current()and cannot be silently deserialized away. The envelope also exposes the pre-change document (previous()) and per-changemetadata()(populated by full-fidelity reads; absent forLatestVersion). A full-fidelity delete returns an emptycurrentobject, which maps toNoneso callers with strict document types still deserialize the delete; the deleted item's identity is available viaChangeFeedMetadata::id()andChangeFeedMetadata::partition_key().ChangeFeedOperationTypeincludes anUnknowncatch-all so a future operation type cannot fail a page and stall the feed. A backend that does not envelope change feed items (such as the Cosmos emulator) returns the bare document, which is mapped ontocurrent()so no data is lost. Added themodelstypesChangeFeedItem<T>,ChangeFeedMetadata,ChangeFeedOperationType, andLogicalSequenceNumber. (#4723) - Added
TlsBackend(re-exported) and atls_backendoption onConnectionPoolOptions(ConnectionPoolOptionsBuilder::with_tls_backend), defaulting toTlsBackend::Rustls, available under therustlsfeature, to pin the TLS backend used by the transport. This is additive and changes no behavior for the default (rustls) build; it only has an effect in builds that compile in multiple reqwest TLS backends, where reqwest would otherwise default to native-tls and the driver now pins rustls instead. (#4649)
Bugs Fixed
http://(non-HTTPS) account endpoints are now rejected unless the host is a known Cosmos DB emulator host, failing fast during client construction with an "invalid account endpoint" error instead of attempting an insecure connection to a production account. This validation also covers configured backup endpoints. (#4757)- Fixed hierarchical-partition-key (HPK) queries. A
FeedScope::partitionscope with only a prefix of the key hierarchy (e.g.("USA", "CA")on a/country/state/citycontainer) now filters to that prefix instead of returning every item in the physical partition (issue #4680), and cross-partition queries over an HPK container no longer fail with400 Bad Request(issue #4681). (#4729) - Fixed the
AZURE_COSMOS_PPCB_*environment variables (includingAZURE_COSMOS_PPCB_ENABLEDand theAZURE_COSMOS_PPCB_ENABLED_OVERRIDEkill switch) being ignored when aCosmosClientwas built without callingCosmosClientBuilder::with_partition_failover_options. The per-partition circuit breaker (PPCB) stayed enabled even withAZURE_COSMOS_PPCB_ENABLED=false. The client's driver now resolves these options from the environment when they are not supplied explicitly. (#4655)