syncache_hive 0.4.0
syncache_hive: ^0.4.0 copied to clipboard
Hive storage backend for Syncache. Provides cross-platform persistent caching with full support for tag-based invalidation, pattern matching, and automatic JSON serialization.
0.4.0 #
Added #
- Index-backed tag operations.
HiveStorenow maintains an in-memory secondary tag index (tag → keys) that is rebuilt lazily on the first tag operation after open — a single box scan that reads only each entry'stagsfield, never deserializing values — and then kept in sync on everywrite/writeWithTags/delete/clear/deleteByTag(s).getKeysByTaganddeleteByTag(s)are O(matches) instead of a full scan that deserializes every value. Corrupted entries are skipped during the rebuild (consistent withread's corruption handling). On-disk format is unchanged — boxes written by earlier versions open as-is. IterableStoresupport (keys()):HiveStorecan enumerate its keys cheaply, enablingSyncache.cleanup()(expired-entry collection) andSyncacheStats.entryCountover persistent caches. Pattern operations already scanned keys only; tests now lock that in.
Changed #
- Dependency alignment with
syncache0.4.0 (constraint raised to^0.4.0).hive_cestays on an honest caret (^2.20.2); the README now documents the upgrade stance forhive_ce's independent major bumps.
0.3.0 #
Added #
HiveMutationOutbox: a durableMutationOutbox(seesyncache0.3.0) backed by its own Hive box (default namesyncache_outbox) — deliberately separate from anyHiveStorecache box, so clearing the cache never destroys unsynced writes. Records persist across close/reopen; corrupted records are skipped and reported via the optionalonErrorcallback instead of crashingloadAll. Safe-close semantics mirrorHiveStore.
0.2.0 #
Changed #
- Version alignment with
syncache0.2.0 (dependency constraint raised to^0.2.0). No functional changes in this package.
0.1.2 #
Changed #
- Dependency swap:
hive→hive_ce^2.20.2.hive_ceis the actively maintained community fork of Hive. It is a drop-in replacement: the API and the on-disk box format are unchanged, so existing boxes open as-is. Apps may keep usinghivedirectly for their own boxes, but the same box file must never be opened by both packages. For Flutter apps, usehive_ce_flutter(instead ofhive_flutter) forinitFlutter(). - Plain
writenow preserves tags previously associated with the key, aligningHiveStorewithMemoryStoreand the tag lifecycle contract documented onTaggableStore. UsewriteWithTags(key, entry, [])to clear tags explicitly.
Added #
- Shared
TaggableStoreconformance suite run againstHiveStore. - Regression test locking in the on-disk entry shape across the storage engine swap.
0.1.0 #
- Initial release
HiveStore<T>implementation ofTaggableStore<T>- Full support for tag-based cache invalidation
- Pattern-based key matching and deletion
- Automatic JSON serialization for metadata
- Atomic operations - tags embedded in entries for consistency
- State management with
isOpen/isClosedproperties - Graceful handling of corrupted data (returns null, deletes entry)
- Idempotent
close()method - Thread-safe
close()- waits for pending operations to complete - Graceful handling of invalid tags data (returns empty list)