cbl 4.0.0-dev.1 copy "cbl: ^4.0.0-dev.1" to clipboard
cbl: ^4.0.0-dev.1 copied to clipboard

An offline-first NoSQL document database with SQL++ queries, vector search, full-text search, live queries, encryption, bi-directional and peer-to-peer data sync.

Couchbase Lite for Dart and Flutter

Couchbase Lite for Dart and Flutter

Version CI codecov

Important

Upgrading from v3? See the migration guide.

Features #

  • SQL++ Queries — A SQL superset designed for JSON documents, with JOINs, aggregations, and parameterized queries.
  • Full-Text Search — Built-in full-text indexing and search.
  • Vector Search — On-device similarity search using vector embeddings. Enterprise Edition
  • Live Queries — Reactive, auto-updating query results.
  • Data Sync — Bi-directional sync with Couchbase Server via Sync Gateway.
  • Peer-to-Peer Sync — Sync directly between devices without a server. Enterprise Edition
  • Encryption — AES-256 database encryption at rest. Enterprise Edition
  • Multi-Platform — Android, iOS, macOS, Windows, Linux.

Getting Started #

Add the package:

dart pub add cbl

Open a database and run a query:

import 'package:cbl/cbl.dart';

Future<void> main() async {
  await CouchbaseLite.init();

  final database = await Database.openAsync('my-database');
  final collection = await database.createCollection('tasks');

  await collection.saveDocument(
    MutableDocument({'title': 'Learn Couchbase Lite', 'done': false}),
  );

  final query = await database.createQuery(
    "SELECT * FROM tasks WHERE done = false",
  );
  final results = await (await query.execute()).allResults();
  print('Pending tasks: ${results.length}');

  await database.close();
}

Read the full documentation at cbl-dart.dev

Enterprise Edition #

By default, the Community Edition is used. To use the Enterprise Edition, configure it in your pubspec.yaml:

hooks:
  user_defines:
    cbl:
      edition: enterprise
  • cbl_sentry — Sentry integration for breadcrumbs and performance tracing.
  • cbl_generator — Code generation for typed document model classes.

Contributing #

Pull requests are welcome. For major changes, please open an issue first. Read CONTRIBUTING to get started.

Disclaimer #

This is not an official Couchbase product.

79
likes
150
points
856
downloads

Documentation

Documentation
API reference

Publisher

verified publishercbl-dart.dev

Weekly Downloads

An offline-first NoSQL document database with SQL++ queries, vector search, full-text search, live queries, encryption, bi-directional and peer-to-peer data sync.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#database #sql #sync #vector-search #full-text-search

License

Apache-2.0 (license)

Dependencies

archive, characters, code_assets, collection, ffi, hooks, http, meta, native_toolchain_c, path, stream_channel, synchronized

More

Packages that depend on cbl