Skip to content

A DatabaseAdapter for the hive database as used by the database_repository package

License

Notifications You must be signed in to change notification settings

glassp/hive_repository

Repository files navigation

Database Repository for Dart

Pub Version GitHub branch checks state

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.
}

About

A DatabaseAdapter for the hive database as used by the database_repository package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages