froom
8.0.0, released 3 weeks ago by an unverified publisher
A typesafe and reactive SQLite abstraction layer for Flutter applications.
What it does
Froom provides automatic mapping between in-memory objects and SQLite database rows while allowing full control through SQL queries. It supports reactive queries using Streams, automatic migrations, upserts, encryption, and web storage via IndexedDB.
AI-written summary of version 8.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want a Room-inspired ORM for SQLite in Flutter with compile-time query verification.
- You need reactive database queries that emit streams of data when tables change.
- You require cross-platform database support including mobile, desktop, and web.
Skip it when
- You prefer a non-relational NoSQL key-value database like Hive or Isar.
- You want to avoid using code generation tools like build_runner in your workflow.
Strengths
- Typesafe API with support for compile-time checked SQL queries.
- Reactive streams for automatic UI updates on database changes.
- Supports automatic migrations, encryption, and full-text search (FTS5).
Weaknesses
- Requires running a code generator (`build_runner`) whenever entities or DAOs change.
- Requires a basic understanding of SQL and SQLite.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 7
Add `froom` to dependencies and `froom_generator` with `build_runner` to dev_dependencies. Run `dart run build_runner build` to generate database code.
final database = await $FroomAppDatabase.databaseBuilder('app_database.db').build();
final personDao = database.personDao;
final person = Person(1, 'Frank');
await personDao.insertPerson(person);
final result = await personDao.findPersonById(1);Alternatives
Packages that do the same job and could replace froom.
Works with
Packages commonly used together with froom: ones it builds on, ones built on it, and its own family.
- sqflite_commonfroom depends on itDart wrapper on SQLite providing the common API for sqflite and desktop FFI implementations.
- sqflite_common_ffifroom depends on itFFI-based implementation of sqflite for desktop platforms and unit tests.
- sqflite_common_ffi_webfroom depends on itSqflite web implementation using sqlite3 ffi and sqlite3 wasm.