Lightweight and blazing fast key-value database written in pure Dart.

Overview

Fast, Enjoyable & Secure NoSQL Database

GitHub Workflow Status (branch) Codecov branch Pub Version GitHub

Hive is a lightweight and blazing fast key-value database written in pure Dart. Inspired by Bitcask.

Documentation & Samples 📖

If you need queries, multi-isolate support or links between objects check out Isar Database.

Features

  • 🚀 Cross platform: mobile, desktop, browser
  • Great performance (see benchmark)
  • ❤️ Simple, powerful, & intuitive API
  • 🔒 Strong encryption built in
  • 🎈 NO native dependencies
  • 🔋 Batteries included

Getting Started

Check out the Quick Start documentation to get started.

Usage

You can use Hive just like a map. It is not necessary to await Futures.

var box = Hive.box('myBox');

box.put('name', 'David');

var name = box.get('name');

print('Name: $name');

Store objects

Hive not only supports primitives, lists and maps but also any Dart object you like. You need to generate a type adapter before you can store objects.

@HiveType(typeId: 0)
class Person extends HiveObject {

  @HiveField(0)
  String name;

  @HiveField(1)
  int age;
}

Extending HiveObject is optional but it provides handy methods like save() and delete().

var box = await Hive.openBox('myBox');

var person = Person()
  ..name = 'Dave'
  ..age = 22;
box.add(person);

print(box.getAt(0)); // Dave - 22

person.age = 30;
person.save();

print(box.getAt(0)) // Dave - 30

Hive ❤️ Flutter

Hive was written with Flutter in mind. It is a perfect fit if you need a lightweight datastore for your app. After adding the required dependencies and initializing Hive, you can use Hive in your project:

import 'package:hive/hive.dart';
import 'package:hive_flutter/hive_flutter.dart';

class SettingsPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ValueListenableBuilder(
      valueListenable: Hive.box('settings').listenable(),
      builder: (context, box, widget) {
        return Switch(
          value: box.get('darkMode'),
          onChanged: (val) {
            box.put('darkMode', val);
          }
        );
      },
    );
  }
}

Boxes are cached and therefore fast enough to be used directly in the build() method of Flutter widgets.

Benchmark

1000 read iterations 1000 write iterations
SharedPreferences is on par with Hive when it comes to read performance. SQLite performs much worse. Hive greatly outperforms SQLite and SharedPreferences when it comes to writing or deleting.

The benchmark was performed on a Oneplus 6T with Android Q. You can run the benchmark yourself.

*Take this benchmark with a grain of salt. It is very hard to compare databases objectively since they were made for different purposes.

Licence

Copyright 2019 Simon Leier

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • The future of Hive

    The future of Hive

    TLDR: Hive 2.0 will be rewritten in Rust to get amazing performance, multithreaded queries, read and write transactions, and super low memory usage. The code will work 1:1 in the browser.

    Situation

    I have thought a long time how to correctly implement queries in Hive and I have come to the conclusion that it is not possible with the current architecture. I have reviewed many projects on GitHub which use Hive and most of them have to create their own suboptimal workaround for queries. Apart from queries, Hive has another problem: Dart objects use much RAM. Since Hive currently keeps at least the keys in RAM, you can hit the OS limit of mobile devices quite fast.

    I also created polls some time ago on the Hive documentation page and there were two very strong takeaways:

    1. Queries are something almost every user wants
    2. An overwhelming majority (86%) of users don't mind breaking changes

    Idea

    So here is what I have come up with: I will completely rewrite Hive in Rust. I will use the strengths of the old implementation (like auto migration) and fix the issues. On the VM, Hive will use LMDB as backend and on the Browser IndexedDB. The VM implementation will provide the same features as IndexedDB to allow easy code sharing. The two main goals of Hive will stay the same: Simplicity and Performance.

    I have a small prototype and the performance is amazing. LMDB has to be some kind of black magic.

    Sample

    Here is how it is going to work:

    The model definition is very similar to current models:

    @HiveType(typeId: 0)
    class Person {
      @Primary
      int id;
    
      @HiveField(fieldId: 0)
      @Index(unique: false)
      String name;
    
      @HiveField(fieldId: 1)
      int age;
    }
    

    Hive will then generate extension methods so you can write the following query:

    var box = Hive.openBox<Person>('persons');
    box
      .query()
      .where()
      .nameEquals('David')
      .or()
      .nameStartsWith('Lu')
      .filter()
      .ageBetween(18, 50)
      .sortedByAge()
    

    where() vs filter()

    The difference between where() and filter() is that where() uses an index and filter() needs to test each of the resulting elements. Normally a database figures out when to use an index itself but Hive will provide you the option to customize.

    There are multiple reasons for that:

    1. This code will work 1:1 with IndexedDB
    2. You know your data best and can choose the perfect index
    3. The database code will be significantly easier

    Things to figure out

    • How can auto-updating queries be implemented efficiently?
    • What are the restrictions for shipping binaries on iOS?
    • Should there still be a key-value store?

    Blocking Issues (pls upvote)

    • dart-lang/sdk#37022
    • dart-lang/sdk#37355
    • flutter/flutter#46887

    Other issues

    • WebAssembly/reference-types#61

    For existing apps using Hive 1.x:

    I will continue to keep a Hive 1.x branch for bugfixes etc.

    What do you think?

    opened by simc 148
  • Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.

    Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.

    hive version: "1.4.0+1" This happen when my app crash and restart immediately by android system

    E/flutter (32001): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: HiveError: This should not happen. Please open an issue on GitHub.
    E/flutter (32001): #0      BinaryReaderImpl.readFrame 
    package:hive/…/binary/binary_reader_impl.dart:244
    E/flutter (32001): #1      FrameHelper.framesFromBytes 
    package:hive/…/binary/frame_helper.dart:15
    E/flutter (32001): #2      FrameIoHelper.framesFromFile 
    package:hive/…/io/frame_io_helper.dart:36
    E/flutter (32001): <asynchronous suspension>
    E/flutter (32001): #3      StorageBackendVm.initialize 
    package:hive/…/vm/storage_backend_vm.dart:72
    E/flutter (32001): <asynchronous suspension>
    E/flutter (32001): #4      BoxBaseImpl.initialize 
    package:hive/…/box/box_base_impl.dart:82
    E/flutter (32001): #5      HiveImpl._openBox 
    package:hive/src/hive_impl.dart:85
    E/flutter (32001): <asynchronous suspension>
    E/flutter (32001): #6      HiveImpl.openBox 
    package:hive/src/hive_impl.dart:106
    E/flutter (32001): #7      HiveConfigBox.open 
    package:liaobei/hive_liaobei/hive_config_box.dart:28
    E/flutter (32001): #8      HiveLiaobeiManager.openUserBox 
    package:liaobei/hive_liaobei/hive_liaobei_manager.dart:80
    E/flutter (32001): <asynchronous suspension>
    E/flutter (32001): #9      main 
    package:liaobei/main.dart:75
    E/flutter (32001): <asynchronous suspension>
    E/flutter (32001): #10     _runMainZoned.<anonymous closure>.<anonymous closure>  (dart:ui/hooks.dart:239:25)
    E/flutter (32001): #11     _rootRun  (dart:async/zone.dart:1126:13)
    E/flutter (32001): #12     _CustomZone.run  (dart:async/zone.dart:1023:19)
    E/flutter (32001): #13     _runZoned  (dart:async/zone.dart:1518:10)
    E/flutter (32001): #14     runZoned  (dart:async/zone.dart:1502:12)
    E/flutter (32001): #15     _runMainZoned.<anonymous closure>  (dart:ui/hooks.dart:231:5)
    E/flutter (32001): #16     _startIsolate.<anonymous closure>  (dart:isolate-patch/isolate_patch.dart:307:19)
    E/flutter (32001): #17     _RawReceivePortImpl._handleMessage  (dart:isolate-patch/isolate_patch.dart:174:12)
    
    bug help wanted 
    opened by daibao520 101
  • Unhandled Exception: HiveError: This is an internal error.

    Unhandled Exception: HiveError: This is an internal error.

    Steps to Reproduce No good way to reproduce, ends up just leaving the app in a dead-start state since a box cannot be opened. All i'm running is openBox on startup (which normally causes no problems)

    E/flutter (16607): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HiveError: This is an internal error. Please open an issue on GitHub and if possible provide a way to reproduce this bug.
    E/flutter (16607): #0      framesFromBytes 
    package:hive/…/binary/frames_from_bytes.dart:22
    E/flutter (16607): #1      FrameIoHelper.framesFromFile 
    package:hive/…/io/frame_io_helper.dart:57
    E/flutter (16607): <asynchronous suspension>
    E/flutter (16607): #2      StorageBackendVm.initialize 
    package:hive/…/backend/storage_backend_vm.dart:109
    E/flutter (16607): <asynchronous suspension>
    E/flutter (16607): #3      BoxBase.initialize 
    package:hive/…/box/box_base.dart:80
    E/flutter (16607): #4      HiveImpl.openBox 
    package:hive/src/hive_impl.dart:76
    E/flutter (16607): <asynchronous suspension>
    E/flutter (16607): #5      MyGuideStorage.init 
    package:app/util/myguide_storage.dart:43
    E/flutter (16607): <asynchronous suspension>
    E/flutter (16607): #6      main 
    package:app/main.dart:21
    E/flutter (16607): #7      _runMainZoned.<anonymous closure>.<anonymous closure>  (dart:ui/hooks.dart:239:25)
    E/flutter (16607): #8      _rootRun  (dart:async/zone.dart:1124:13)
    E/flutter (16607): #9      _CustomZone.run  (dart:async/zone.dart:1021:19)
    E/flutter (16607): #10     _runZoned  (dart:async/zone.dart:1516:10)
    E/flutter (16607): #11     runZoned  (dart:async/zone.dart:1500:12)
    E/flutter (16607): #12     _runMainZoned.<anonymous closure>  (dart:ui/hooks.dart:231:5)
    E/flutter (16607): #13     _startIsolate.<anonymous closure>  (dart:isolate-patch/isolate_patch.dart:305:19)
    E/flutter (16607): #14     _RawReceivePortImpl._handleMessage  (dart:isolate-patch/isolate_patch.dart:172:12)
    

    Version

    • Platform: Android (Hardware Q) and IOS (simulator latest)
    • Flutter version: v1.10.15-pre.151
    • Hive version: 1.1.0-beta2

    Note that the same issue happens when downgrading back to flutter stable

    Finally, During this installation, I did not clear data (using box.clear) so i dont think it's related to #71

    bug 
    opened by cyberpwnn 61
  • Update Problem

    Update Problem

    Question I am using the hive database for making my items as favorite and show them in a list.

    While clicking a button " favoriteBox.add(Favorite(id, name,place,featuredImage,rating,));"

    if I click that button again then the same data is coming into the list again.

    is there any way to overcome this problem?

    I need to know how can I update a column in the hive.

    I am just showing the item in a list. I just want to update it from my screen.

    question 
    opened by muhammednazil 50
  • deleteFromAllBoxes()

    deleteFromAllBoxes()

    Problem Having the same object referenced across multiple boxes it's possible to save() It will update the object in all the boxes the object it's referenced to. But if you delete() the object it only deletes from the box you are referencing.

    If you have something like

    Fruit (box)
    -String name
    
    Basket (box)
    -List<Fruit> items
    

    If you add the object to both Box, you can have edit the fruit name from any box, but if you can't delete the object from all boxes.

    In database this can be expected behavior or not.

    Feature Request Have a alternative deleteFromAllBoxes()

    enhancement 
    opened by peekpt 43
  • Migrate hive to dart nnbd

    Migrate hive to dart nnbd

    For now, package:hive was migrated, and every test passes, but there are some hacks on the test's codegen and package:crypto and package:mockito have been overriden with git versions which were not published on pub.dev. The tests also depend on the legacy package:dartx and package:pointycastle, so they can only be ran with --no-sound-null-safety.

    The release is blocked until at least package:crypto has an published non-nullable version.

    Ill start working on the hive_generator, as hive needed to be migrated first because it is an direct dependency of the packages which would use the generator.

    enhancement 
    opened by KalilDev 31
  • Make Hive working with @immutable class

    Make Hive working with @immutable class

    @leisim Hi there! It will be awesome to get this awesome plugin Freezed working with immutable models, so we can have immutable model that can be generated and stored directly in Hive database.

    cc: @rrousselGit

    enhancement 
    opened by peekpt 30
  • DateTimeAdapter don't take timezone in consideration

    DateTimeAdapter don't take timezone in consideration

    Steps to Reproduce DateTime fields are saved used local DateTime. My data is synced to a server which will restore the data on a phone change/reinstall. If the user is in a different timezone, all times are wrong when restoring the database.

    The DateTimeAdapter should be writer.writeInt(obj.toUtc).millisecondsSinceEpoch) and DateTime.fromMillisecondsSinceEpoch(micros, isUtc: true).toLocal().

    Version

    • Platform: iOS, Android, Mac, Windows, Linux, Web
    • Flutter version: [e.g. 1.5.4]
    • Hive version: [e.g. 0.5.0]
    problem 
    opened by JCKodel 28
  • HiveError: Cannot read, unknown typeId: 38. Did you forget to register an adapter?

    HiveError: Cannot read, unknown typeId: 38. Did you forget to register an adapter?

    Steps to Reproduce

    Previous code before the issue

    The registration of the adapter:

    registerAdapter(ShelfAdapter());
    registerAdapter(ShelfProductAdapter());
    

    My Models + Adapter:

    @HiveType(typeId: 4)
    class Product implements Identifiable {
      @HiveField(0)
      @override
      final String id;
      @HiveField(1)
      final String name;
    
      @HiveField(2)
      final ProductType type;
    
      const Product({
        @required this.id,
        @required this.name,
        @required this.type,
      });
    }
    
    
    part of 'product.dart';
    
    // **************************************************************************
    // TypeAdapterGenerator
    // **************************************************************************
    
    class ProductAdapter extends TypeAdapter<Product> {
      @override
      final typeId = 4;
    
      @override
      Product read(BinaryReader reader) {
        var numOfFields = reader.readByte();
        var fields = <int, dynamic>{
          for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
        };
        return Product(
          id: fields[0] as String,
          name: fields[1] as String,
          type: fields[2] as ProductType,
        );
      }
    
      @override
      void write(BinaryWriter writer, Product obj) {
        writer
          ..writeByte(3)
          ..writeByte(0)
          ..write(obj.id)
          ..writeByte(1)
          ..write(obj.name)
          ..writeByte(2)
          ..write(obj.type);
      }
    }
    
    part 'product_type.g.dart';
    
    @HiveType(typeId: 4)
    class ProductType {
    
      @HiveField(0)
      final int value;
    
      const ProductType(this.value);
    }
    
    
    part of 'product_type.dart';
    
    // **************************************************************************
    // TypeAdapterGenerator
    // **************************************************************************
    
    class ProductTypeAdapter extends TypeAdapter<ProductType> {
      @override
      final typeId = 4;
    
      @override
      ProductType read(BinaryReader reader) {
        var numOfFields = reader.readByte();
        var fields = <int, dynamic>{
          for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
        };
        return ProductType(fields[0] as int);
      }
    
      @override
      void write(BinaryWriter writer, ProductType obj) {
        writer
          ..writeByte(1)
          ..writeByte(0)
          ..write(obj.value);
      }
    }
    

    So far, so good. But I want to remove the child object / adapter because we don't need it from now on. So let's completely remove the ProjectType and the ProjectTypeAdapter.

    And not the App is crashing with the following Issue:

    HiveError: Cannot read, unknown typeId: 38. Did you forget to register an adapter?

    After a complete new installation everything is working fine.

    Version

    • Platform: iOS, Android
    • Flutter version: 1.17.2 • channel stable
    • Package versions:
      • hive: ^1.4.1+1
      • hive_flutter: ^0.3.0+2
    enhancement 
    opened by stefanschaller 26
  • Help needed: New documentation

    Help needed: New documentation

    A good documentation is crucial for a library. I started working on a new version and would love to get some help from you guys. If you have an idea of how to improve the docs, please comment below or create a pull request in the docs repository.

    The new documentation also allows live code.

    You can find it here: newdocs.hivedb.dev

    documentation help wanted 
    opened by simc 25
  • HiveError: Cannot read, unknown typeId: 32. Did you forget to register an adapter?

    HiveError: Cannot read, unknown typeId: 32. Did you forget to register an adapter?

    When I try start the app this error always appears: HiveError: Cannot read, unknown typeId: 32. Did you forget to register an adapter?

    My Hivetype:

    import 'package:flutter/cupertino.dart';
    import 'package:hive/hive.dart';
    
    part 'auth_token_response_model.g.dart';
    
    @HiveType(typeId: 1)
    class  AuthTokenResponseModel {
    
      AuthTokenResponseModel({@required this.accessToken, @required this.refreshToken,  @required this.accessTokenExpirationDateTime,  @required this.idToken,  @required this.tokenType});
    
      @HiveField(0)
      final String accessToken;
      @HiveField(1)
      final String refreshToken;
      @HiveField(2)
      final DateTime accessTokenExpirationDateTime;
      @HiveField(3)
      final String idToken;
      @HiveField(4)
      final String tokenType;
    }
    

    g.dart file:

    part of 'auth_token_response_model.dart';
    // **************************************************************************
    // TypeAdapterGenerator
    // **************************************************************************
    
    class AuthTokenResponseModelAdapter
        extends TypeAdapter<AuthTokenResponseModel> {
      @override
      AuthTokenResponseModel read(BinaryReader reader) {
        var numOfFields = reader.readByte();
        var fields = <int, dynamic>{
          for (var i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
        };
        return AuthTokenResponseModel(
          accessToken: fields[0] as String,
          refreshToken: fields[1] as String,
          accessTokenExpirationDateTime: fields[2] as DateTime,
          idToken: fields[3] as String,
          tokenType: fields[4] as String,
        );
      }
      @override
      void write(BinaryWriter writer, AuthTokenResponseModel obj) {
        writer
          ..writeByte(5)
          ..writeByte(0)
          ..write(obj.accessToken)
          ..writeByte(1)
          ..write(obj.refreshToken)
          ..writeByte(2)
          ..write(obj.accessTokenExpirationDateTime)
          ..writeByte(3)
          ..write(obj.idToken)
          ..writeByte(4)
          ..write(obj.tokenType);
      }
      @override
      int get typeId => 1;
    }
    

    Main:

    await Hive.initFlutter();
        final appDocumentDir = await path_provider.getApplicationDocumentsDirectory();
        Hive.init(appDocumentDir.path);
        Hive.registerAdapter(AuthTokenResponseModelAdapter());
        await HiveService.hiveInit();
    

    hiveInit:

    static Future<Box> hiveInit() async {
        await Hive.openBox('userlogin');
        await Hive.openBox('skipped');
        await  Hive.openBox('lastSearched');
      }
    

    Version

    • Platform: iOS, Android
    • Flutter version: v1.12.13+hotfix.8
    • Hive version: hive: ^1.0.0 hive_flutter: ^0.3.0+2
    problem 
    opened by dominikkeller 24
  • chore: Use `unawaited` instead of ignoring the lint

    chore: Use `unawaited` instead of ignoring the lint

    Using unawaited provides more context about the purpose of not awaiting a future and it has no effects. In this commit, I simply deleted the "ignore lint" comment and wrapped the remove function in unawaited.

    Following is the implementation of unawaited (from "dart:async" package):

    /// Explicitly ignores a future.
    ///
    /// Not all futures need to be awaited.
    /// The Dart linter has an optional ["unawaited futures" lint](https://dart-lang.github.io/linter/lints/unawaited_futures.html)
    /// which enforces that potential futures
    /// (expressions with a static type of [Future] or `Future?`)
    /// in asynchronous functions are handled *somehow*.
    /// If a particular future value doesn't need to be awaited,
    /// you can call `unawaited(...)` with it, which will avoid the lint,
    /// simply because the expression no longer has type [Future].
    /// Using `unawaited` has no other effect.
    /// You should use `unawaited` to convey the *intention* of
    /// deliberately not waiting for the future.
    ///
    /// If the future completes with an error,
    /// it was likely a mistake to not await it.
    /// That error will still occur and will be considered unhandled
    /// unless the same future is awaited (or otherwise handled) elsewhere too.
    /// Because of that, `unawaited` should only be used for futures that
    /// are *expected* to complete with a value.
    /// You can use [FutureExtensions.ignore] if you also don't want to know
    /// about errors from this future.
    @Since("2.15")
    void unawaited(Future<void>? future) {}
    
    opened by f-person 0
  • flutter  hive 2.2.3   hive-2.2.3/lib/src/hive_impl.dart:119:9: Error: The getter 'unrethrow' isn't defined     for the class 'HiveImpl'.

    flutter hive 2.2.3 hive-2.2.3/lib/src/hive_impl.dart:119:9: Error: The getter 'unrethrow' isn't defined for the class 'HiveImpl'.

    Error1: /hive-2.2.3/lib/src/hive_impl.dart:119:9: Error: The getter 'unrethrow' isn't defined for the class 'HiveImpl'. Try correcting the name to the name of an existing getter, or defining a getter or field named 'unrethrow'. unrethrow;

    Error2: hive-2.2.3/lib/src/hive_impl.dart:61:22: Error: A non-null value must be returned since the return type 'BoxBase' doesn't allow null. - 'BoxBase' is from 'package:hive/hive.dart' ('../../../.pub-cache/hosted/pub.dartlang.org/hive-2.2.3/lib/hive.dart'). Future<BoxBase> _openBox(

    flutter --version Flutter 3.3.10 • channel stable • https://github.com/flutter/flutter.git Framework • revision 135454af32 (3 weeks ago) • 2022-12-15 07:36:55 -0800 Engine • revision 3316dd8728 Tools • Dart 2.18.6 • DevTools 2.15.0

    flutter doctor [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.74.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

    problem 
    opened by zhoushuangjian001 0
  • Hive.close is not unregistering adapters

    Hive.close is not unregistering adapters

    I want to close Hive temporarily to reinit Hive in another location with other Adapters. The only way I can do that is using the method "resetAdapters()", which docs says.

    /// Clears all registered adapters. /// /// To register an adapter use [registerAdapter]. /// /// NOTE: [resetAdapters] also clears the default adapters registered /// by Hive. /// /// WARNING: This method is only intended to be used for integration and unit tests /// and SHOULD not be used in production code.

    Is there an acceptable way to do that?

    Thank you

    enhancement 
    opened by busslina 0
  • Nested type registries

    Nested type registries

    The goal of this PR is to add nested registries to hive in order to increase typeId limit for the models.

    The original implementation has been written by @xal with https://github.com/hivedb/hive/pull/804.

    The final design adds the following api to the hive TypeRegistry interface (which is accessible through Hive singleton value).

    Hive.registerNestedAdapters((registry) {
      registry.registerAdapter<User>(UserAdapter());
    }, parentTypeId: 3);
    

    Basically put the registerNestedAdapters method lets users to allocate a single typeId and use it for a nested type registry which can be used for registering multiple types with a single id. The nested type registry has similar characteristics as the global type registry like 256 typeId space for each nested registry, typeIds should be unique and should not be changed after being written to the disk.

    opened by themisir 0
  • Why does getAt have a nullable return type if it throws an exception on out of range errors?

    Why does getAt have a nullable return type if it throws an exception on out of range errors?

    Question The getAt() function's return type is E?. However, when I call getAt with an index outside of range, I get a thrown exception with an out of range error. When would getAt actually return null if E was not a nullable type? Should getAt's return type be just "E" instead of "E?" ?

    Version

    • Platform: Android
    • Flutter version: 3.3.9
    • Hive version: 2.2.3
    question 
    opened by spekary 0
Releases(v3.0.0-dev)
  • v3.0.0-dev(Oct 15, 2022)

    What's Changed

    • added the notify parameter to the functions of the public API by @tomassasovsky in https://github.com/hivedb/hive/pull/1019
    • feat: implement Web Worker support by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/1030
    • feat: add .gitignore by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/1035
    • feat: improve BinaryWriter API by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/986
    • Implement fully working StorageBackendMemory by @grieshofer in https://github.com/hivedb/hive/pull/1036
    • feat: store open boxes including collection by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/1038
    • fix: missing TupleBoxKey for opening boxes by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/1041
    • fix(hive_generator): Apply analyzer 5.0.0 or higher by @jukqaz in https://github.com/hivedb/hive/pull/1085

    New Contributors

    • @tomassasovsky made their first contribution in https://github.com/hivedb/hive/pull/1019
    • @grieshofer made their first contribution in https://github.com/hivedb/hive/pull/1036
    • @jukqaz made their first contribution in https://github.com/hivedb/hive/pull/1085

    Full Changelog: https://github.com/hivedb/hive/compare/v2.2.3...v3.0.0-dev

    Source code(tar.gz)
    Source code(zip)
  • v2.2.3(Jun 30, 2022)

    What's Changed

    • fix: Remove print from deleteBoxFromDisk by @krillefear in https://github.com/hivedb/hive/pull/1015
    • feat: made resetAdapters public by @alestiago in https://github.com/hivedb/hive/pull/1014

    New Contributors

    • @krillefear made their first contribution in https://github.com/hivedb/hive/pull/1015
    • @alestiago made their first contribution in https://github.com/hivedb/hive/pull/1014

    Full Changelog: https://github.com/hivedb/hive/compare/v2.2.2...v2.2.3

    Source code(tar.gz)
    Source code(zip)
  • v2.2.1(May 18, 2022)

    What's Changed

    • hive_generator: Update Analyzer version. by @ryojiro in https://github.com/hivedb/hive/pull/969
    • fix: provide fallback backend manager by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/968

    New Contributors

    • @ryojiro made their first contribution in https://github.com/hivedb/hive/pull/969

    Full Changelog: https://github.com/hivedb/hive/compare/v2.2.0...v2.2.1

    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(May 17, 2022)

    What's Changed

    • Upstream FluffyBox patches by @TheOneWithTheBraid in https://github.com/hivedb/hive/pull/956

    New Contributors

    • @TheOneWithTheBraid made their first contribution in https://github.com/hivedb/hive/pull/956

    Full Changelog: https://github.com/hivedb/hive/compare/v2.1.0...v2.2.0

    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Mar 20, 2022)

    What's Changed

    • Do not return uninitialized box by @maRci002 in https://github.com/hivedb/hive/pull/916
    • Support adapter type inheritance by @saibotma in https://github.com/hivedb/hive/pull/927
    • Close uninitialized boxes by @themisir in https://github.com/hivedb/hive/pull/917
    • Support UTF-8 keys by @themisir in https://github.com/hivedb/hive/pull/928

    New Contributors

    • @saibotma made their first contribution in https://github.com/hivedb/hive/pull/927

    Full Changelog: https://github.com/hivedb/hive/compare/v2.0.6...v2.1.0

    Source code(tar.gz)
    Source code(zip)
  • v2.0.6(Feb 24, 2022)

    What's Changed

    • Updated hive_generator analyzer dependency by @NatsuOnFire in https://github.com/hivedb/hive/pull/858
    • Change pedantic to linter and fix warnings by @themisir in https://github.com/hivedb/hive/pull/876
    • Fix: This should not happen. Please open an issue on GitHub. by @maRci002 in https://github.com/hivedb/hive/pull/914

    New Contributors

    • @NatsuOnFire made their first contribution in https://github.com/hivedb/hive/pull/858
    • @maRci002 made their first contribution in https://github.com/hivedb/hive/pull/914

    Full Changelog: https://github.com/hivedb/hive/compare/v2.0.5...v2.0.6

    Source code(tar.gz)
    Source code(zip)
  • v2.0.5(Dec 16, 2021)

    Enhancements

    • Get IndexedDB selectively based on window property - #802
    • Added path parameter to boxExists and deleteBoxFromDisk methods - #776
    • Added flush method to boxes - #852

    Fixes

    • Don't loose track of box objects if init crashes - #846
    Source code(tar.gz)
    Source code(zip)
  • v2.0.4(Jun 20, 2021)

  • v2.0.3(Apr 13, 2021)

  • v2.0.0(Mar 7, 2021)

  • v1.6.0-nullsafety.0(Jan 30, 2021)

  • v1.5.0-pre(Oct 4, 2020)

  • v1.4.4(Aug 20, 2020)

  • v1.4.3(Aug 9, 2020)

  • v1.4.1+1(Feb 26, 2020)

  • v1.4.1(Feb 22, 2020)

    Enhancements

    • Minor performance improvements

    Fixes

    • When a database operation failed, subsequent operations would not be performed

    Other

    • Fixed GitHub homepage path
    Source code(tar.gz)
    Source code(zip)
  • hive_generator_v0.7.0+2(Feb 22, 2020)

  • hive_flutter_v0.3.0+2(Feb 22, 2020)

  • 1.4.0+1(Feb 8, 2020)

  • v1.4.0(Feb 7, 2020)

    Enhancements

    • ~1000% encryption / decryption performance improvement
    • Added option to implement custom encryption algorithm
    • Added box.valuesBetween(startKey, endKey)
    • Allow tree shaking to drop encryption engine if no encryption is used

    Fixes

    • Hive.deleteBoxFromDisk() did not work for boxes with upper-case names

    More

    • Deprecated encryptionKey parameter. Use Hive.openBox('name', encryptionCipher: HiveAesCipher(yourKey)).
    • Dropped pointycastle dependency
    • Dropped path dependency
    Source code(tar.gz)
    Source code(zip)
  • v1.3.0(Jan 3, 2020)

    Use latest version of hive_generator

    Breaking changes

    • TypeAdapters and @HiveType() now require a typeId
    • Hive.registerAdapter() does not need a typeId anymore.
    • Removed BinaryReader.readAsciiString()
    • Removed BinaryWriter.writeAsciiString()

    Enhancements

    • New documentation with tutorials and live code

    Fixes

    • box.clear() resets auto increment counter

    More

    • Not calling Hive.init() results in better exception
    Source code(tar.gz)
    Source code(zip)
  • v1.2.0(Dec 22, 2019)

    Use latest version of hive_generator

    Breaking changes

    • Removed the Hive.path getter
    • Removed Hive.openBoxFromBytes() (use the bytes parameter of Hive.openBox() instead)
    • LazyBox and Box now have a common parent class: BoxBase
    • Lazy boxes need to be opened using Hive.openLazyBox()
    • Open lazy boxes can be aquired using Hive.lazyBox()
    • Box name bug resolved (more information below)

    Enhancements

    • Support for relationships, HiveLists (see docs for details)
    • Support for inheritance
    • Lazy boxes can now have a type argument LazyBox<YourModel>
    • Added method to delete boxes without opening them Hive.deleteBoxFromDisk()
    • Added path parameter to open boxes in a custom path
    • Improved documentation

    Fixes

    • HiveObjects have not been initialized correctly in lazy boxes
    • Fixed bug where uppercase box name resulted in an uppercase filename
    • Fixed compaction bug which caused corrupted boxes
    • Fixed bug which did not allow the key 0xFFFFFFFF
    • Fixed bug where not all BoxEvents have been broadcasted

    More

    • Changed type of encryptionKey from Uint8List to List<int>

    Important:

    Due to a bug in previous Hive versions, boxes whose name contains uppercase characters were stored in a file that also contains upper case characters (e.g. 'myBox' -> 'myBox.hive').

    To avoid different behavior on case sensitive file systems, Hive should store files with lower case names. This bug has been resolved in version 1.2.0.

    If your box name contains upper case characters, the new version will not find a box stored by an older version. Please rename the hive file manually in that case.
    This also applies to the web version.

    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Oct 22, 2019)

    Breaking changes

    • object.delete() now throws exception if object is not stored in a box

    Fixes

    • Fixed bug where object.save() would faild on subsequent calls
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0+2(Oct 18, 2019)

  • v1.1.0+1(Oct 17, 2019)

  • v1.1.0(Oct 16, 2019)

    Breaking changes

    • Changed return type of addAll() from List<int> to Iterable<int>.
    • Removed the option to register TypeAdapters for a specific box. E.g. box.registerTypeAdapter().
    • getAt(), putAt(), deleteAt() and keyAt() no longer allow indices out of range.

    Enhancements

    • Added HiveObject
    • Boxes have now an optional type parameter Box<E>
    • Support opening boxes from assets

    Fixes

    • Fixed bug which was caused by not awaiting write operations
    • Fixed bug where custom compaction strategy was not applied
    • Hive now locks box files while they are open to prevent concurrent access from multiple processes

    More

    • Improved performance of putAll(), deleteAll(), add(), addAll()
    • Changed values parameter of addAll() from List to Iterable
    • Improved documentation
    • Preparation for queries
    Source code(tar.gz)
    Source code(zip)
Owner
HiveDB
Hive is a lightweight and blazing fast key-value database written in pure Dart.
HiveDB
A fast, extra light and synchronous key-value storage to Get framework

get_storage A fast, extra light and synchronous key-value in memory, which backs up data to disk at each operation. It is written entirely in Dart and

Jonny Borges 257 Dec 21, 2022
The lightweight and powerful wrapper library for Twitter Ads API written in Dart and Flutter 🐦

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Twitter.dart 2 Aug 26, 2022
Simple and fast Entity-Component-System (ECS) library written in Dart.

Fast ECS Simple and fast Entity-Component-System (ECS) library written in Dart. CPU Flame Chart Demonstration of performance for rotation of 1024 enti

Stanislav 8 Nov 16, 2022
A lightweight and powerful batch library written in Dart

A lightweight and powerful batch library written in Dart. You can easily develop a job schedule and batch program in Dart with this library.

Kato Shinya 24 Dec 13, 2022
Fast math TeX renderer for Flutter written in Dart.

CaTeX is a Flutter package that outputs TeX equations (like LaTeX, KaTeX, MathJax, etc.) inline using a widget and Flutter only - no plugins, no web v

simpleclub 56 Nov 14, 2022
DartMeltySoundFont - a SoundFont synthesizer (i.e. '.sf2' player) written in pure Dart

DartMeltySoundFont DartMeltySoundFont is a SoundFont synthesizer (i.e. '.sf2' player) written in pure Dart. It is a port of MeltySynth (C#, MIT Licens

Chip Weinberger 11 Oct 29, 2022
A simple set of terminal-based arcade games written in pure Dart.

dartcade A simple set of terminal-based arcade games written in pure Dart. Purpose I was developing some simple 2D UI libraries (such as package:gridd

Matan Lurey 7 Dec 7, 2022
SurrealDB client written in pure dart. auto reconnect, typed functions

SurrealDB Client For Dart & Flutter SurrealDB client for Dart and Flutter. Quick Start import 'package:surrealdb/surrealdb.dart'; void main(List<Stri

Duhan BALCI 10 Dec 18, 2022
A flutter plugin to play Youtube Videos without API Key in range of Quality(144p, 240p,360p,480p,720p and 1080p).

Youtube Player Plugin This plugin is discontinued. Please use youtube_player_flutter which is an officially provided way of playing youtube videos, su

Sarbagya Dhaubanjar 120 Nov 13, 2022
Netflix app UI clone using bloc,Rest API and TMDB for API key

netflix_flutter project_using_bloc packages Used flutter_bloc json_serializable get_it dio A few resources to get you started if this is your first Fl

Pranav Pv 16 Nov 25, 2022
A degital diary with key feature of saving your thoughts with image

localstore A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if th

null 1 Nov 13, 2021
Behruz Hurramov 0 Dec 29, 2021
WIP: generate easy localization key code

Generates translation key code for the easy localization package. Support for json and yaml formats.You can see examples in the assets/ folder. Gettin

null 3 Oct 24, 2022
This is the Zuri Chat Android app project repository handled by TEAM SOCRATES, written with pure Flutter.

Zuri Chat Overview This is the Zuri Chat Android app project repository handled by TEAM SOCRATES, written with pure Flutter. NB: Always contact Team l

Zuri Chat 32 Nov 22, 2022
A Dart package that helps to implement value based equality without needing to explicitly override == and hashCode.

Simplify Equality Comparisons Overview Being able to compare objects in Dart often involves having to override the == operator as well as hashCode. No

Felix Angelov 747 Jan 8, 2023
A working Twitter clone written in Flutter using Firebase auth,realtime,firestore database and storage

A working Twitter clone written in Flutter using Firebase auth,realtime,firestore database and storage

The Github Mafia 17 Dec 24, 2022
How to get the most value from Dart static analysis

This package is deprecated. Before it was deprecated, it was the way to get analysis options matching those used internally at Google. This was useful

Google 324 Nov 4, 2022
How to get the most value from Dart static analysis

This package is deprecated. Before it was deprecated, it was the way to get analysis options matching those used internally at Google. This was useful

Google 324 Nov 4, 2022
dna, dart native access. A lightweight dart to native super channel plugin

dna, dart native access. A lightweight dart to native super channel plugin, You can use it to invoke any native code directly in contextual and chained dart code.

Assuner 14 Jul 11, 2022