azure_cosmosdb
Connector for Azure Cosmos DB on Dart and Flutter platforms. Supports Cosmos DB SQL API, indexing policies, users, permissions, and spatial types.
4.0.0
d-markey/azure_cosmosdb
What this package is like to depend on
Last release 3 months ago
05 May 2026
Ships unpredictably
gaps range from 8 days to 1.2 years
Nearly every release is documented
notes for 22 of 22 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
22 releases · first in 2022
1 release in the last 12 months
see the full history below
Release timeline
22 releases · Jun 2022 to May 2026
2023
2024
2025
2026
Releases
latest 22-
4.0.005 May 2026 -
3.0.009 Feb 2025Release notes
Open source →- Add support for stored procedures, user-defined functions and triggers. See accessors
sprocs,udfsandtriggersinCosmosDbContainer. Please refer to unit tests for examples calling custom scripts. - Add support for
conflictResolutionPolicyon containers. - Add support for
defaultTtlon containers. - Add support for
analyticalStorageTtlon containers (experimental, untested).
- Add support for stored procedures, user-defined functions and triggers. See accessors
-
2.3.119 Jan 2025Release notes
Open source →- BREAKING CHANGE: reworked the access-control classes and methods.
useAuthorization()/usePermission()are deprecated in favor ofgrantAccess(), andclearAuthorization()/clearPermission()in favor ofrevokeAccess(). Optional argumentsauthorizationandpermissionare replaced byaccessControl. - Make document ids non-nullable (
Objectinstead ofdynamic).
- BREAKING CHANGE: reworked the access-control classes and methods.
-
2.3.011 Jan 2025Release notes
Open source →- Rename
AuthorizationtoCosmosDbAuthorizationand make it public. - Add optional
authorizationparameter to methods already supportingCosmosDbPermission. - Make
usePermissionobsolete: please useuseAuthorizationinstead. ACosmosDbAuthorizationcan be built from aCosmosDbPermission. - Rename
InvalidTokenExceptiontoParsingException. - Add new
InvalidTokenExceptionas an HTTP exception for invalid or missing tokens. - Reworked tests & activate Wasm tests.
- Update jGenHTML to version 1.6 (test coverage tooling).
- Rename
-
2.2.226 Feb 2024Release notes
Open source →- Fix lints warnings reported by pub.dev.
- Update tests as https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3659 has been fixed.
-
2.2.121 Jan 2024Release notes
Open source →- Add support for older containers where
PartitionKeySpec.versionis null -- fixes https://github.com/d-markey/azure_cosmosdb/issues/12.
- Add support for older containers where
-
2.2.013 Oct 2023Release notes
Open source →- Add none constructor to throughput for serverless config - PR https://github.com/d-markey/azure_cosmosdb/pull/10 by https://github.com/djkingCanada - fixes https://github.com/d-markey/azure_cosmosdb/issues/7.
- Improve error message if partition key is not provided for a new container - PR https://github.com/d-markey/azure_cosmosdb/pull/9 by https://github.com/djkingCanada.
-
2.1.127 Jun 2023 -
2.1.013 May 2023 -
2.0.204 Mar 2023 -
2.0.129 Jan 2023Release notes
Open source →- Improved documentation & tests.
- Retry batch operations failing with a 429 "Too many requests" status.
-
2.0.014 Jan 2023Release notes
Open source →- Added [PartitionKeySpec] for partition key definition. A [PartitionKeySpec] must be provided when creating a [CosmosDbContainer]. The static final instance [PartitionKeySpec.id] can be used as the default partition key
['/id']. When opening an existing collection, the [PartitionKeySpec] is loaded from the Cosmos DB response. [PartitionKeySpec.from] extracts the partition key from a [BaseDocument] according to the partition key definition. - Support for multiple paths in [PartitionKeySpec] is available, in which case the [CosmosDbServer] connection must be initialized with
preview: true. - Added [PartitionKey] for providing a partition key when operating on documents/queries. The special value [PartitionKey.all] enables cross-partition queries.
- Added [TransactionalBatch] and [CrossPartionBatch] for batch processing.
- Please note that support for batch and multi-partition key are still experimental.
- Breaking changes - several classes have been renamed e.g. [CosmosDbCollection] --> [CosmosDbContainer], APIs dealing with bare
Stringpartition keys now use [PartitionKey]/[PartitionKeySpec], etc.
- Added [PartitionKeySpec] for partition key definition. A [PartitionKeySpec] must be provided when creating a [CosmosDbContainer]. The static final instance [PartitionKeySpec.id] can be used as the default partition key
-
1.8.107 Jan 2023Release notes
Open source →_client.dart: return early withnullupon a "204 - No Content" status code (fix for https://github.com/d-markey/azure_cosmosdb/issues/1). Also skip parsing the response body ifcontent-lengthis zero.
-
1.8.017 Dec 2022Release notes
Open source →- Added support for patching documents. A document may be patched conditionally and the condition can be parameterized (parameter values are integrated into the condition client-side, as Cosmos DB does not accept parameterized conditions out-of-the-box). Variable names MUST start with
@. - Added
CosmosDbCollection.get()to retrieve the latest version of a document. When thedocumenthas mixinEtagMixin, the value of the_etagfield is sent to Cosmos DB in theIf-None-Matchheader (causing a response with HTTP status code 304 "Not modified", in which case thedocumentis returned as is). - Added optional
documentparameter forCosmosDbCollection.delete(). When provided, thedocumentattributes takes over theidvalue. Theidparameter is deprecated and will eventually be removed. - Added optional
checkEtagparameter (default value:true) forCosmosDbCollection.delete()andCosmosDbCollection.replace(). When thedocumenthas mixinEtagMixinandcheckEtagistrue, the value of the_etagfield is sent to Cosmos DB in theIf-Matchheader. If the document has been updated in the meantime, aPreconditionFailureExceptionexception will be thrown because the_etagfield's value will have changed in Cosmos DB (causing a response with HTTP status code 412 "Precondition failure"). - Added
PartitionKeyfield onCosmosDbCollectionand markedPartitionKeysas obsolete. UsePartitionKeyinstead. - Added
PartitionKeyMixinto support custom partition keys in documents. - Added support for throttling requests when Cosmos DB replies with HTTP status code 429 "Too many requests".
- Added support for patching documents. A document may be patched conditionally and the condition can be parameterized (parameter values are integrated into the condition client-side, as Cosmos DB does not accept parameterized conditions out-of-the-box). Variable names MUST start with
-
1.6.110 Dec 2022Release notes
Open source →- Update README.md
- Added support for throughput when creating a database or a collection.
-
1.6.008 Dec 2022Release notes
Open source →- Renamed
Lineclass toLineString. - Fix various issues in GeoJSON serialization (lat/long order in the JSON-array, serialization/deserialization...).
- Added unit tests to validate the spatial data sets used in tests.
- Added unit tests for spatial queries.
- Renamed
-
1.5.005 Dec 2022Release notes
Open source →- Supports bounding box in spatial indexes.
- New class
Pointto represent spatial positions.- 2D/3D euclidean coordinates (aka geometry).
- Latitude/longitude/optional altitude coordinates (aka geography).
- New classes to represent shapes supported by CosmosDB:
Line,Polygon,MultiPolygon. - Distance calculators for both geometrical (euclidean) and geographical (latitude/longitude) shapes.
- Comes with a geographical distance calculator preconfigured with the Earth's radius in kilometers.
- Renamed
Exceptionclass toCosmosDbException(could be a breaking change). - Most base classes
ClassNamehave also been renamed toCosmosDbClassName.- This should eliminate the need for aliasing the Cosmos DB library while avoiding name collisions in your app. E.g. names for
User,Collection, ... were too generic and could cause conflict with your code or other libraries. - This should not be a breaking change as previous names are still available, yet deprecated. They will be removed in a future version.
- This should eliminate the need for aliasing the Cosmos DB library while avoiding name collisions in your app. E.g. names for
- Removed
DebugHttpClientfrom the mainstreamazure_cosmosdblibrary (could be a breaking change).- The debug HTTP client can still be used by importing
azure_cosmosdb_debuginstead.
- The debug HTTP client can still be used by importing
- Test cases have been updated accordingly, and enriched to cover indexing policies and geometrical/geographical shapes.
-
1.0.029 Nov 2022 -
0.9.319 Oct 2022 -
0.9.218 Oct 2022 -
0.9.112 Oct 2022 -
0.9.021 Jun 2022Release notes
Open source →- Initial release.
- Support for Server, Databases, Collections, Users and Permissions
- Document base classes: BaseDocument, BaseDocumentWithEtag
- Support for SQL query
- Unit tests & code coverage (currently limited to Server, Databases and Collections)