sembast_sqflite
2.2.4+2, released 11 days ago by tekartik.com
Sembast NoSQL database support built on top of sqflite for cross-process safety.
WASM-ready
What it does
Provides a NoSQL document database API backed by an SQLite journaling layer. It enables fast in-memory access combined with cross-process safe database storage and transactions.
AI-written summary of version 2.2.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a NoSQL Sembast database interface that is cross-process safe.
- You want fast in-memory NoSQL access backed by SQLite storage.
Skip it when
- You are using multiple isolates to access the same sembast_sqflite database (it should be used from the main isolate only).
- You want standard raw SQLite queries without a NoSQL abstraction layer.
Strengths
- Cross-process safe database storage and transaction mechanism.
- Familiar Sembast NoSQL API backed by sqflite.
Weaknesses
- Should be used from the main isolate only.
- Can encounter locked access if multiple transactions are in progress concurrently.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Follow setup instructions for platform-specific dependencies required by sqflite.
import 'package:sembast_sqflite/sembast_sqflite.dart';
import 'package:sqflite/sqflite.dart' as sqflite;
Future main() async {
final factory = getDatabaseFactorySqflite(sqflite.databaseFactory);
var store = StoreRef<String, String>.main();
var record = store.record('my_key');
var db = await factory.openDatabase('test.db');
await record.put(db, 'my_value');
print(await store.stream(db).first);
await db.close();
}Alternatives
Packages that do the same job and could replace sembast_sqflite.
Works with
Packages commonly used together with sembast_sqflite: ones it builds on, ones built on it, and its own family.
- synchronizedsembast_sqflite depends on itLock mechanism to prevent concurrent access to asynchronous code.
- sqflite_commonsembast_sqflite depends on itDart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
- sembastsembast_sqflite depends on itA NoSQL persistent embedded document-based database for Dart and Flutter.
- sqfliteSame familySQLite plugin for Flutter supporting iOS, Android and MacOS.
- sqflite_common_ffiSame familyFFI-based implementation of sqflite for desktop platforms and unit tests.
- idb_shimSame familyCross-platform IndexedDB implementation for Dart and Flutter.
- 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.