Skip to content
pubscout

cbl_dart

3.5.2, released 2 weeks ago by cbl-dart.dev

Embedded NoSQL JSON document database for pure Dart and Flutter apps.

$ flutter pub add cbl_dart
Source repository

What it does

Provides an embedded, NoSQL document-style database supporting JSON documents, blobs, encryption, SQL++ queries, full-text search, and data synchronization. It runs across Android, iOS, Windows, macOS, and Linux.

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

Use it when

  • You need a robust, local NoSQL document database in a pure Dart or Flutter app.
  • You require advanced features like SQL++ queries, full-text search, and data synchronization.
  • You need to store and observe complex, deeply nested JSON structures locally.

Skip it when

  • You only need simple key-value persistence and prefer a lighter dependency.
  • You strictly require a relational SQL database without document store complexity.

Strengths

  • Cross-platform support spanning mobile and desktop operating systems.
  • Rich querying capabilities using SQL++ and full-text search.
  • Supports live queries and database change notifications.

Weaknesses

  • Heavier footprint compared to basic key-value stores.
  • Not an official Couchbase product.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6

Standalone Dart and Flutter with no manual setup required, just add the package.

import 'package:cbl/cbl.dart';

Future<void> run() async {
  final database = await Database.openAsync('database');
  final collection = await database.createCollection('components');
  
  final mutableDocument = MutableDocument({'type': 'SDK', 'majorVersion': 2});
  await collection.saveDocument(mutableDocument);
  
  await database.close();
}

Alternatives

Packages that do the same job and could replace cbl_dart.

  • sqflite

    You prefer a traditional SQLite relational database interface over a NoSQL document store.

  • drift

    You want a type-safe SQL database builder for Dart and Flutter.

  • shared_preferences

    You only need simple key-value storage for small configuration settings.

Works with

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