datum_hive 1.1.0
datum_hive: ^1.1.0 copied to clipboard
A Hive-based persistence layer for the Datum ecosystem, enabling efficient local data storage and synchronization for Flutter applications
1.1.0 #
- Fix — rows are keyed by
(userId, id): the box was keyed by entity id alone, so one user's create/update silently overwrote another user's same-id row, anddelete/patchignored the owner entirely — cross-user data destruction. Rows now use composite, escape-safe box keys; legacy boxes are re-keyed automatically oninitialize()with every row preserved. Applies to bothHiveLocalAdapterandIsolatedHiveLocalAdapter. - Fix — watch streams emit initial snapshots:
watchAllemitted NOTHING until the next box event, so screens watching an already-populated box rendered empty forever. Every listener now gets a current snapshot (suppressed withincludeInitialData: false), a second concurrent listener works, andwatchByIdis implemented. Certified byrunWatchConformanceTests. - Auto-migration support: both adapters mix in
SchemaFingerprintCapable, persisting the declaration fingerprint in the metadata box (__datum_schema_fingerprint__) soDatumConfig.autoMigratereconciliation is run-once across launches. query()now actually honorsDatumQuery(filters, sorting, pagination) viaDatumQueryMatcherinstead of returning all entities.- Implemented
readAllPaginated()for paginated local reads. - Added
watchQuery()for reactive, query-scoped streams. - Fixed: the schema version is now persisted in the metadata box. Previously it lived only in memory, so schema migrations re-ran on every app launch — corrupting data for non-idempotent transforms. Applies to both
HiveLocalAdapterandIsolatedHiveLocalAdapter. - Fixed:
overwriteAllRawData()stores the raw maps as given instead of round-tripping through the entity, so columns added by a migration are no longer silently dropped. - Fixed:
clearUserData()passed entity value maps instead of box keys todeleteAll, so it threw aTypeErrorwhenever the user actually had stored entities (both adapters). It now deletes exactly the user's entities. - Requires
datum ^1.1.0.
0.0.2 #
- Update for datum dependency
0.0.1 #
- Initial Release with Datum