hive_repository 1.0.2 hive_repository: ^1.0.2 copied to clipboard
A DatabaseAdapter for the hive database as used by the database_repository package
Database Repository for Dart #
Use this database adapter for hive to integrate with database_repository
Using Flutter? #
Better use hive_flutter_repository as it integrates better with flutter
How to install #
dart pub add hive_repository
How to use #
void main() {
final pathWhereHiveShouldLive = /* Some path that is writable */
final myDatabaseAdapter = HiveDatabaseAdapter(path: pathWhereHiveShouldLive);
// Register a Database Adapter that you want to use.
DatabaseAdapterRegistry.register(myDatabaseAdapter);
final repository = DatabaseRepository.fromRegistry(serializer: mySerializer, name: 'hive');
// Now use some methods such as create() etc.
}