Releases: objectbox/objectbox-dart
v4.0.3
- Generator: replace cryptography library, allows to use newer versions of the transitive
js
dependency. #638 - iOS: support
Query.findWithScores()
with big objects (> 4 KB), previously would throw a
StorageException: Do not use vector-based find on 32 bit systems with big objects
. #676 - Make closing the Store more robust. It waits for ongoing queries and transactions to finish.
This is just an additional safety net. Your code should still make sure to finish all Store
operations, like queries, before closing it. - Flutter for Linux/Windows, Dart Native: update to objectbox-c 4.0.2.
- Flutter for iOS/macOS: update to objectbox-swift 4.0.1.
Existing projects may have to runpod repo update
andpod update ObjectBox
. - Flutter for Android: update to objectbox-android 4.0.3.
If you are using Admin, make sure to
update toio.objectbox:objectbox-android-objectbrowser:4.0.3
inandroid/app/build.gradle
.
Sync
- Fix a serious regression, please update as soon as possible.
- Add special compression for tiny transactions (internally).
v4.0.2
- Sync: support option to enable shared global IDs.
Note: this release includes the same versions of the Android library and ObjectBox pod as release 4.0.0.
See update instructions there.
v4.0.1
- Export
ObjectWithScore
andIdWithScore
used by the new find with scoreQuery
methods. #637 - Add simple
vectorsearch_cities
Dart Native example application.
Note: this release includes the same versions of the Android library and ObjectBox pod as release 4.0.0.
See update instructions there.
V4.0 Vector Search
To upgrade to this major release run flutter pub upgrade objectbox --major-versions
(or for Dart Native apps dart pub upgrade objectbox --major-versions
).
ObjectBox now supports Vector Search to enable efficient similarity searches.
This is particularly useful for AI/ML/RAG applications, e.g. image, audio, or text similarity. Other use cases include semantic search or recommendation engines.
Create a Vector (HNSW) index for a floating point vector property. For example, a City
with a location vector:
@Entity()
class City {
@HnswIndex(dimensions: 2)
@Property(type: PropertyType.floatVector)
List<double>? location;
}
Perform a nearest neighbor search using the new nearestNeighborsF32(queryVector, maxResultCount)
query condition and the new "find with scores" query methods (the score is the distance to the
query vector). For example, find the 2 closest cities:
final madrid = [40.416775, -3.703790];
final query = box
.query(City_.location.nearestNeighborsF32(madrid, 2))
.build();
final closest = query.findWithScores()[0].object;
For an introduction to Vector Search, more details and other supported languages see the
Vector Search documentation.
- The generator correctly errors when using an unsupported index on a vector type.
- Flutter for Linux/Windows, Dart Native: update to objectbox-c 4.0.0.
- Flutter for Android: update to objectbox-android 4.0.0.
If you are using Admin, make sure to
update toio.objectbox:objectbox-android-objectbrowser:4.0.0
inandroid/app/build.gradle
. - Flutter for iOS/macOS: update to objectbox-swift 2.0.0.
Existing projects may have to runpod repo update
andpod update ObjectBox
.
v2.5.1
- Add
SyncCredentials.userAndPassword()
. - Change
SyncCredentials
from constructors to static methods. This should not require any changes
Note: this release includes the same versions of the Android library and ObjectBox pod as release 2.5.0. See update instructions there.
v2.5.0
-
Support creating file-less in-memory databases, for example for caching or testing. To create one
pass an in-memory identifier together withStore.inMemoryPrefix
as thedirectory
: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 aStore
.
This is different from the existingmaxDBSizeInKB
property in that it is possible to remove data
after reaching the limit and continue to use the database. See theStore
documentation for more
details. -
For
DateTime
properties new convenience query conditions are generated that acceptDateTime
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 #392For 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-runningflutter 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 toio.objectbox:objectbox-android-objectbrowser:3.8.0
inandroid/app/build.gradle
. -
Flutter for iOS/macOS: update to objectbox-swift 1.9.2.
Existing projects may have to runpod repo update
andpod update ObjectBox
.
v2.4.0
-
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 toio.objectbox:objectbox-android-objectbrowser:3.7.1
inandroid/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 runpod repo update
andpod 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
- 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
-
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 withIndexType.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
andpod 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
- 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
.