web library

The browser opener and its database classes, for code that only runs in a browser: tests, debugging, is checks. Apps use sqliteOpener of package:cloud_firestore_dart_sqlite/cloud_firestore_dart_sqlite.dart, which compiles on every platform.

Classes

SqliteOpfsDatabase
One open SQLite database in OPFS, kept by its own dedicated worker. FirebaseFirestore runs its own SQL through it. Like SqliteWebDatabase it holds the Web Lock of the database while it is open (ExclusiveDatabase).
SqliteWebDatabase
One open SQLite database in IndexedDB. FirebaseFirestore runs its own SQL through it.

Functions

inspectOpfsDatabase({required Uri opfsWorker, required Uri sqlite3Wasm, required String storageName}) → Future<SqliteOpfsDatabase?>
Opens the OPFS database storageName as it is, without the Web Lock, the schema steps or the IndexedDB import of sqliteWebOpener: to look at a database that nothing else has open (tests, debugging). Returns null when the browser has no synchronous OPFS access in workers.
sqliteWebOpener({required Uri sqlite3Wasm, Uri? opfsWorker, String storagePrefix = 'cloud_firestore_dart', Duration lockTimeout = const Duration(seconds: 2), bool acceptIndexedDbWriteLoss = false}) → OpenDatabase
Returns an OpenDatabase that keeps each database in IndexedDB, or in the origin private file system (OPFS) when opfsWorker is given and the browser supports it.

Exceptions / Errors

SqliteOpfsException
An error that SQLite (or the file system) reported in the OPFS worker.