sembast_web
2.4.7, released 11 days ago by tekartik.com
NoSQL persistent embedded database for the Web on top of IndexedDB.
WASM-readyRock solid
What it does
Provides a NoSQL embedded database implementation for web applications using IndexedDB as the underlying storage. It supports cross-tab synchronization and transactions.
AI-written summary of version 2.4.6+1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a NoSQL embedded database specifically for Flutter Web or browser applications.
- You want data to synchronize across multiple open browser tabs.
Skip it when
- You are looking for a relational SQL database solution.
- You require built-in data encryption via codecs (which are not supported).
Strengths
- Content and transactions are synchronized across all open browser tabs.
- Supports both JS and WASM targets.
Weaknesses
- Codecs are not supported on the web.
- Transactions must be idempotent because they may run again in case of concurrent access.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Add sembast_web to your pubspec.yaml dependencies.
import 'package:sembast/sembast.dart';
import 'package:sembast_web/sembast_web.dart';
Future main() async {
var store = intMapStoreFactory.store();
var factory = databaseFactoryWeb;
var db = await factory.openDatabase('test');
var key = await store.add(db, <String, Object?>{'name': 'Table', 'price': 15});
var value = await store.record(key).get(db);
print(value);
await db.close();
}Alternatives
Packages that do the same job and could replace sembast_web.
- hive_ce
Alternative NoSQL database for Flutter and Dart.
96Compare - shared_preferences
Simpler key-value storage alternative if a full NoSQL database is overkill.
97Compare
Works with
Packages commonly used together with sembast_web: ones it builds on, ones built on it, and its own family.
- websembast_web depends on itLightweight bindings for browser APIs via JS interop
- synchronizedsembast_web depends on itLock mechanism to prevent concurrent access to asynchronous code.
- sembastsembast_web depends on itA NoSQL persistent embedded document-based database for Dart and Flutter.
- idb_shimsembast_web depends on itCross-platform IndexedDB implementation for Dart and Flutter.
- sqflite_commonSame familyDart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
- sqflite_common_ffiSame familyFFI-based implementation of sqflite for desktop platforms and unit tests.
- process_runSame familyRun shell scripts and locate executables across Linux, Windows and macOS.
- sqflite_common_ffi_webSame familySqflite web implementation using sqlite3 ffi and sqlite3 wasm.