hivez 1.2.2
hivez: ^1.2.2 copied to clipboard
The cleanest way to use Hive databases in production. 1000x faster queries, auto-initialization, type-safe, and unified API. (Wrapping hive_ce)
1.2.2 #
- Added missing exports for
IsolatedHiveInterface
inhivez_flutter
package
1.2.1 #
- Updated README
1.2.0 #
-
5× Faster IndexedBox & Engine Overhaul
IndexedBox
is now up to 5× faster in search, insert, and update operations.
Introduced a new unified internal engine with stricter initialization and lighter background handling, improving performance, stability, and memory use across all box types. -
New
searchFiltered
andsearchPaginated
Extensions
Introduced two new high-level querying helpers forIndexedBox
:searchFiltered()
— adds optionalfilter
,sortBy
,limit
, andoffset
support to any search query, enabling flexible in-memory filtering and custom sorting over indexed results.searchPaginated()
— provides built-in pagination support with optionalprePaginate
mode for faster page-based queries on large datasets.
-
Improved Type-Safety for Add Operations — Added type validation to prevent misuse of
add()
andaddAll()
on non-int-keyed boxes. Calls now throwInvalidAddOperationException
orInvalidAddAllOperationException
instead of failing silently for incorrect key types, ensuring safer and more predictable behavior.final box = HivezBox<String, User>('users'); await box.add(User(...)); // ❌ Throws InvalidAddOperationException
-
Fixed
addAll
— now correctly returns the Iterable of IDs of the added values (instead ofFuture<void>
like before), making it clear which IDs were generated when adding many entries at once. -
Fixed
keyAt
— The return type ofkeyAt
is now nullable (Future<K?>
) to match native Hive and avoid exceptions when an index has no key. -
Extensive Production-Scale Benchmarking - Added comprehensive benchmarks targeting boxes with up to 1,000,000 items, measuring both query times and the performance of bulk writes. Below are sample results comparing HivezBox (standard Box) and IndexedBox performance on the same hardware: On a box with
1,000,000 items
, search is
~1640x
faster with IndexedBox (22.90ms vs 37,621.74ms
, or a 99.94% reduction in time). -
Dedicated Benchmark Folder - Added a designated folder containing all extensive benchmark tests, so you can run them yourself and verify performance on your own hardware.
-
New Methods for all box types:
getMany(keys)
— Efficiently retrieve multiple values by their keys.replaceAll(entries)
— Clears all existing data and replaces it with a new map of entries.
1.1.0 #
New Indexed Box
- Ultra-fast full-text search for Hive #
A special box that maintains a lightweight full‑text token index for extremely fast searches over your values. It wraps a regular box and keeps an auxiliary index box plus a small journal/meta box for crash‑safe updates.
-
Performance: compared to a regular, non‑indexed box, searches are dramatically faster (
100x
to3000x
in real-world benchmarks). You can tune behavior via the analyzer (basic
,prefix
,ngram
),matchAllTokens
, a customkeyComparator
, and the token cache capacity. -
Create an indexed box and tell it how to extract searchable text
final box = IndexedBox<int, Article>( 'articles', searchableText: (a) => "${a.title} ${a.body}", // or just a.title, it's up to you ); final articles = await box.search('flutter dart'); // Blazing fast search
📘 Now with complete documentation
This release includes full, production-grade docs featuring detailed explanations, real-world examples, and step-by-step guides for every feature — from basic box usage to advanced search analyzers, configuration, and clean architecture patterns.
Click here to view the complete documentation.
New Box
API - Universal classes with improved functionality #
-
A universal class that can be used to create all box types.
final box = Box<int, User>('users');
final box = Box<int, User>('users', type: BoxType.lazy); // easy to switch between box types final box = Box<int, User>('users', type: BoxType.isolated); // all types of boxes supported final box = Box<int, User>.lazy('users'); // many syntax variations
-
Comes with
BoxConfig
,BoxType
, andBoxCreator
, for easier box configuration and creation:final box = BoxConfig.lazy('users').createBox<int, User>(); // example final box = BoxType.lazy.createBox<int, User>('users'); // example
New methods for all box types #
getKeysWhere()
— returns keys matching a condition.firstKeyWhere()
— returns the first key matching a condition.searchKeyOf()
— returns the key for a given value.estimateSizeBytes()
— estimates the approximate in-memory size of box contents (bytes).toMap()
— now supports lazy boxes.
1.0.2 #
1.0.1 #
- Added example file for pub.flutter-io.cn
- Updated README.md with more detailed examples and sections
1.0.0 #
- Added proper API comments and documentation
- Removed unnecessary
hive_ce
export inside thehivez
package - Added exports from
hive_ce
to thehivez_flutter
package - Completed all essential documentation
0.0.11 #
- Created
hivez_flutter
package for Flutter usage to easily import all additionalhive_ce
dependencies. Now all you need is to importhivez_flutter
instead ofhivez
andhive_ce_flutter
andhive_ce
in your Flutter projects (If you don't need to use them directly).
0.0.10 #
- Added
moveKey
method to reassign a value from one key to another (renames the key while preserving the value). - Added
foreachKey
andforeachValue
methods to iterate over all keys and values in the box - Made the base
BoxInterface
class simpler for better abstraction and flexibility - Added exports from
hive_ce
to the package for ease of use - Updated the README with more detailed examples and better structure with sections Features, Hive vs
Hivez
Comparison, How to UseHivez
, Examples, Setup Guide forhive_ce
0.0.9 #
- Improved API structure, type safety and made unnecessary public members private
- Improved logging performance by using a function builder instead of a string literal
- Added basic logs to
initialize
,flush
,compact
,deleteFromDisk
, andcloseBox
operations - Added extensive tests for backup extension methods for all box types testing both JSON and compressed backups and many more tests for all box types
- Fixed missing exports for extension methods
- To improve the auto-completion and code readability, renamed boxes from
HivezBox
HivezLazyBox
HivezIsolatedBox
HivezIsolatedLazyBox
- to
HivezBox
,HivezBoxLazy
,HivezBoxIsolated
,HivezBoxIsolatedLazy
0.0.8 #
- Improved performance by removing unnecessary checks and validation while making the package even more type safe and flexible
- Added search extension methods for all box types, and added extensive tests with all box types
search
for searching the box for values that match the search query. It supports pagination, sorting and improved search with multiple search terms.
- Fixed casting issues with isolated boxes
0.0.7 #
- Implemented extensive testing for all box types and functions
- Tests for
put
,get
,putAll
,containsKey
,keys
,length
,isEmpty
,isNotEmpty
,delete
,deleteAt
,deleteAll
,clear
,generateBackupJson
,restoreBackupJson
,generateBackupCompressed
,restoreBackupCompressed
- Box types tested:
HivezBox
,HivezLazyBox
,HivezIsolatedBox
,HivezIsolatedLazyBox
0.0.6 #
- Created backup extension methods for all box types, it uses the existing json backup extension methods and compresses the json string using the
shrink
package with compression ratios of 5x-40xgenerateBackupCompressed
for generating compressed backupsrestoreBackupCompressed
for restoring compressed backups
- Started setting up testing for the package
- Implemented test setup utilities using the
hive_ce_flutter
package - Added testing dev dependencies
0.0.5 #
- Created backup extension methods for all box types, it saves all data existing in the box to a json string and allows to restore the data from the json string back to the box
generateBackupJson
for generating json backupsrestoreBackupJson
for restoring json backups
0.0.4 #
- Added all box types, all ready to use out of the box
HivezBox
for regular boxesHivezLazyBox
for lazy boxesHivezIsolatedBox
for regular isolated boxesHivezIsolatedLazyBox
for lazy isolated boxes
0.0.3 #
- Added abstract boxes
AbstractHivezBox
for lazy and regular boxesAbstractHivezIsolatedBox
for lazy and regular isolated boxes
- Implemented shared functionality for all boxes
0.0.2 #
- Changed
BaseHiveService
toBaseHivezBox
for better abstraction and flexibility - Created core functionality, exceptions and base interfaces for Hivez boxes
- Added future support for all operations including isolated boxes
- Updated dart sdk dependency to support up to 4.0.0
- Updated README.md links
0.0.1 #
Initial release of hivez package.
- Introduced
BaseHiveService<K, T>
for managing Hive boxes:- Lazy initialization via
ensureInitialized()
with overridableonInit()
hook - Concurrency-safe operations using
synchronizedWrite
andsynchronizedRead
- Guarded
box
getter; throwsHiveServiceInitException
if uninitialized - Utilities:
closeBox()
,deleteFromDisk()
, optional logging viaLogHandler
anddebugLog()
- Lazy initialization via
- Added
HiveServiceInitException
for uninitialized service access