sqlbrite
2.8.0, released 2 years ago by hoc081098.dev
Reactive stream wrapper around sqflite for Flutter.
WASM-ready
What it does
Sqlbrite wraps sqflite databases to introduce reactive stream semantics to SQL operations. Queries return streams that emit new data immediately and again whenever the underlying table is modified.
AI-written summary of version 2.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want reactive SQL queries in Flutter using sqflite and RxDart.
- You need automatic query re-execution when tables are updated.
Skip it when
- You need a full ORM or type-safe query mechanism.
- You need automated database migrations.
Strengths
- Integrates seamlessly with sqflite and RxDart.
- Provides convenient extension methods like mapToOne and mapToList.
- Allows full control of query notification frequency using RxDart operators.
Weaknesses
- Not an ORM or a type-safe query builder.
- Does not handle database migrations.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 4
Wrap an existing sqflite Database instance in a BriteDatabase.
final Database db = await openDb();
final briteDb = BriteDatabase(db);
final Stream<List<Entity>> listQuery$ = briteDb.createQuery(
'table',
where: 'name LIKE ?',
whereArgs: [queryName],
).mapToList((row) => Entity.fromJson(row));Alternatives
Packages that do the same job and could replace sqlbrite.
Works with
Packages commonly used together with sqlbrite: ones it builds on, ones built on it, and its own family.
- sqflite_commonsqlbrite depends on itDart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
- sqflitesqlbrite depends on itSQLite plugin for Flutter supporting iOS, Android and MacOS.
- rxdart_extsqlbrite depends on itExtension methods and classes built on top of RxDart like Single and StateStream.
- rx_storageSame familyReactive key-value storage powered by RxDart