Skip to content

Releases: objectbox/objectbox-dart

v2.5.0

14 Feb 14:09
Compare
Choose a tag to compare
  • Support creating file-less in-memory databases, for example for caching or testing. To create one
    pass an in-memory identifier together with Store.inMemoryPrefix as the directory:

     final inMemoryStore =
         Store(getObjectBoxModel(), directory: "${Store.inMemoryPrefix}test-db");

    See the Store documentation for details.

  • Add Store.removeDbFiles() to conveniently delete database files or an in-memory database.

  • Add Store.dbFileSize() to get the size in bytes of the main database file or memory occupied by
    an in-memory database.

  • Add relationCount() query condition to match objects that have a certain number of related
    objects pointing to them. E.g. Customer_.orders.relationCount(2) will match all customers with
    two orders. Customer_.orders.relationCount(0) will match all customers with no associated order.
    This can be useful to find objects where the relation was dissolved, e.g. after the related object
    was removed.

  • Support for setting a maximum data size via the maxDataSizeInKB property when building a Store.
    This is different from the existing maxDBSizeInKB property in that it is possible to remove data
    after reaching the limit and continue to use the database. See the Store documentation for more
    details.

  • For DateTime properties new convenience query conditions are generated that accept DateTime
    and auto-convert to milliseconds (or nanoseconds for @Property(type: PropertyType.dateNano)) #287

    // For example instead of:
    Order_.date.between(DateTime(2024, 1).millisecondsSinceEpoch, DateTime(2024, 2).millisecondsSinceEpoch)
    // You can now just write:
    Order_.date.betweenMilliseconds(DateTime(2024, 1), DateTime(2024, 2))
  • When defining a property with a getter and setter instead of a field, support annotating the
    getter to configure or ignore the property #392

    For example, it is now possible to do this:

    @Property(type: PropertyType.date)
    @Index()
    DateTime get date => TODO;
    set date(DateTime value) => TODO;
    
    @Transient()
    int get computedValue => TODO;
    set computedValue(int value) => TODO;
  • For Flutter apps: loadObjectBoxLibraryAndroidCompat() is now called by default when using
    openStore() (effective after re-running flutter pub run build_runner build). For devices
    running Android 6 or older this will pre-load the ObjectBox library in Java to prevent errors when
    loading it in Dart.

    If your code was calling the compat method manually, remove the call and re-run above command.

    Let us know if there are issues with this change in #369!

  • Avoid conflicts with entity class names in generated code #519

  • Flutter for Linux/Windows, Dart Native: update to objectbox-c 0.21.0.

  • Flutter for Android: update to objectbox-android 3.8.0.
    If you are using Admin, make sure to
    update to io.objectbox:objectbox-android-objectbrowser:3.8.0 in android/app/build.gradle.

  • Flutter for iOS/macOS: update to objectbox-swift 1.9.2.
    Existing projects may have to run pod repo update and pod update ObjectBox.

v2.4.0

13 Dec 11:44
Compare
Choose a tag to compare
  • Fix crash in Flutter plugin when running in debug mode on iOS. #561

  • Support Flutter projects using Android Gradle Plugin 8. #581

  • Flutter for Linux/Windows: fix CMake build deprecation warning. #522

  • Flutter for Linux/Windows, Dart Native: update to objectbox-c 0.20.0.

  • Flutter for Android: update to objectbox-android 3.7.1.
    If you are using Admin, make sure to update to io.objectbox:objectbox-android-objectbrowser:3.7.1 in android/app/build.gradle.
    Notably requires Android 4.4 (API level 19) or higher.

  • Flutter for iOS/macOS: update to objectbox-swift 1.9.1.
    Existing projects may have to run pod repo update and pod update ObjectBox.
    Notably requires iOS 12.0 and macOS 10.15 or higher.

  • Sync: add Sync.clientMultiUrls to work with multiple servers.

v2.3.1

09 Oct 13:13
Compare
Choose a tag to compare
  • Fix "Loaded ObjectBox core dynamic library has unsupported version 0.18.1" on Android. #563
  • Support downloading 64-bit ARM library when building a Flutter app on Linux. Let us know if this works as expected in #564

In this release objectbox_flutter_libs and objectbox_sync_flutter_libs continue to use objectbox-android 3.7.0 and Pod ObjectBox 1.9.0.

v2.3.0

19 Sep 14:46
Compare
Choose a tag to compare
  • Query support for integer and floating point lists: For integer lists (excluding byte lists)
    greater, less and equal are supported on elements of the vector (e.g. "has element greater").

    For floating point lists greater and less queries are supported on elements of the vector
    (e.g. "has element greater").

    A simple example is a shape entity that stores a palette of RGB colors:

    @Entity()
    class Shape {
        @Id()
        int id = 0;
    
        // An array of RGB color values that are used by this shape.
        Int32List? palette;
    }
    
    // Find all shapes that use red in their palette
    final query = store.box<Shape>()
            .query(Shape_.palette.equals(0xFF0000))
            .build();
    query.findIds();
    query.close();
  • Queries: all expected results are now returned when using a less-than or less-or-equal condition
    for a String property with IndexType.value. #318

  • Queries: when combining multiple conditions with OR and adding a condition on a related entity
    ("link condition") the combined conditions are now properly applied. #546

  • Update: objectbox-c 0.19.0.
    Notably now requires glibc 2.28 or higher (and GLIBCXX_3.4.25); e.g. at least Debian Buster 10
    (2019) or Ubuntu 20.04
    .

  • Update: objectbox-swift 1.9.0. Existing projects may have to run pod repo update and pod update ObjectBox.

  • Update: objectbox-android 3.7.0.
    If you are using Admin, make sure to update to
    io.objectbox:objectbox-android-objectbrowser:3.7.0.

v2.2.1

22 Aug 13:16
Compare
Choose a tag to compare
  • Resolve an issue where not all query results are returned, when an entity constructor or property
    setter itself executes a query. #550

In this release objectbox_flutter_libs ships with objectbox-android 3.5.1 and ObjectBox pod 1.8.1.

v2.2.0

08 Aug 15:06
Compare
Choose a tag to compare
  • For Flutter apps running on Android 6 (or older): added loadObjectBoxLibraryAndroidCompat() to
    objectbox_flutter_libs (and objectbox_sync_flutter_libs). Use this to fix loading the
    ObjectBox library on these devices.

    Let us know if this works for you in #369!
    We might consider calling this automatically in a future release.

  • Improve code generator performance if there are many entities with many constructor parameters.

  • Throw StateError instead of crashing on closed Box, Query and PropertyQuery.

  • Export query property classes to make them usable in user code.

  • Resolve an issue where unexpected data was returned when doing a read operation in an entity constructor or property setter. #550

In this release objectbox_flutter_libs ships with objectbox-android 3.5.1 and ObjectBox pod 1.8.1.

v2.1.0

13 Jun 12:02
Compare
Choose a tag to compare
  • Support for integer and floating point lists: store 8-bit, 16-bit, 32-bit and 64-bit integer
    lists as well as 32-bit and 64-bit floating point lists (called "vectors" by ObjectBox).

    Use a typed_data class like Int16List, Uint16List or Float32List for large lists, it uses
    less memory and CPU. Otherwise just use a Dart number list.

    A simple example is a shape entity that stores a palette of RGB colors:

    @Entity()
    class Shape {
        @Id()
        int id = 0;
    
        // An array of RGB color values that are used by this shape.
        Int32List? palette;
    }

    This can also be useful to store vector embeddings produced by machine learning:

    @Entity()
    class ImageEmbedding {
        @Id()
        int id = 0;
    
        // Link to the actual image, e.g. on Cloud storage
        String? url;
    
        // The coordinates computed for this image (vector embedding)
        @Property(type: PropertyType.floatVector)
        List<double>? coordinates;
    }

    Note: for queries currently only the isNull and notNull conditions are supported.

  • Changed PropertyType.char from a 8-bit signed integer to a 16-bit unsigned integer to match the
    ObjectBox database type.

  • Fix put returning an incorrect error message in a rare case.

  • Require at least Dart SDK 2.18 (shipped with Flutter 3.3.0).

  • Let Store.awaitQueueCompletion actually wait on the async queue to become idle. It previously
    behaved like Store.awaitQueueSubmitted.

  • Fix analysis event send failure breaking the code generator. #542

In this release objectbox_flutter_libs ships with objectbox-android 3.5.1 and ObjectBox pod 1.8.1.

v2.0.0

21 Mar 10:41
Compare
Choose a tag to compare

To upgrade to this major release run flutter pub upgrade objectbox --major-versions
(or for Dart Native apps dart pub upgrade objectbox --major-versions).

  • Breaking changes to generated code: run flutter pub run build_runner build
    (or dart run build_runner build for Dart Native apps) after updating!
  • Added and updated async APIs in Box:
    • new getAsync, getManyAsync, getAllAsync,
    • new putAsync and putManyAsync which support objects with relations,
    • renamed the former putAsync to putQueuedAwaitResult,
    • new putAndGetAsync and putAndGetManyAsync which return a copy of the given objects with new
      IDs set.
    • new removeAsync, removeManyAsync and removeAllAsync.
  • Add new async Query APIs: findAsync, findFirstAsync, findUniqueAsync, findIdsAsync and
    removeAsync.
  • Support sending objects containing ToOne and ToMany across isolates, e.g. when using
    store.runInTransactionAsync. #340
  • Store.attach (and Store.fromReference) do not longer accept a null model, which was not
    supported anyhow.
  • Breaking change: renamed store.awaitAsyncSubmitted and awaitAsyncCompletion to
    awaitQueueSubmitted and awaitQueueCompletion to avoid any mix-up with the new async methods.
  • Removed deprecated Store.runIsolated.
  • Require at least Dart SDK 2.15 (shipped with Flutter 2.8.0).

In this release objectbox_flutter_libs ships with objectbox-android 3.5.1 and ObjectBox pod 1.8.1.

v1.7.2

31 Jan 12:57
Compare
Choose a tag to compare

We're hiring! 😎 We believe resource-efficient coding is still cool and are looking for a C / C++ developer who shares our sentiment.

v1.7.0

15 Dec 14:54
Compare
Choose a tag to compare
  • Support more concise method chaining when using a sort order with a query:
    // BEFORE
    final query = (box.query()..order(Person_.name)).build();
    // AFTER
    final query = box.query().order(Person_.name).build();
  • Allow analyzer with major version 5. #487
  • Generator not longer warns that it can not find the package source root if the output directory is
    the package root directory.
  • Query: add .containsElement, deprecate .contains condition for List<String>. #481
  • Add StorageException which is a ObjectBoxException with an errorCode (a OBX_ERROR code).
  • Throw DbFullException instead of ObjectBoxException with message 10101 Could not put (error
    code OBX_ERROR_DB_FULL).
  • Change Query.findUnique() to throw NonUniqueResultException instead of
    UniqueViolationException if there is more than one result.
  • Update: objectbox-c 0.18.0.
  • Update: objectbox-android 3.5.0. If you are using Admin, make sure to update your objectbox-android-objectbrowser dependency.
  • Update: objectbox-swift 1.8.1-rc.
  • (Data) Sync only: protocol updates improving efficiency. Reach out via your existing contact to check if any actions are required for your setup.