Skip to content
pubscout

azure_cosmosdb

4.0.0, released 7 months ago by d-markey.ovh

Connector for Azure Cosmos DB on Dart and Flutter platforms.

WASM-ready
$ flutter pub add azure_cosmosdb
Source repository

What it does

Provides a client to communicate with Azure Cosmos DB. Supports the Cosmos DB SQL API, indexing policies, users, permissions, spatial types, and batch operations.

AI-written summary of version 4.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to connect a Dart or Flutter application to Azure Cosmos DB
  • You require support for Cosmos DB SQL API, indexing policies, and spatial types

Skip it when

  • You are using a different cloud backend like Firebase or Supabase
  • You need local-first SQLite or NoSQL storage on the device instead of a remote database

Strengths

  • Comprehensive support for Cosmos DB features including spatial types and batch operations
  • Supports multiple platforms including Android, iOS, Web, Windows, macOS, and Linux

Weaknesses

  • Not supported nor endorsed by Microsoft

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
5

Instantiate CosmosDbServer with your endpoint and master key or permission token.

final cosmosDB = CosmosDbServer('https://localhost:8081/', masterKey: '/* your master key*/');
final database = await cosmosDB.databases.openOrCreate(
  'ToDoDb',
  throughput: CosmosDbThroughput.minimum,
);

Works with

Packages commonly used together with azure_cosmosdb: ones it builds on, ones built on it, and its own family.