Skip to content

Commit b4b5088

Browse files
Merge branch 'objectbox-5.0.0' into 'main'
ObjectBox 5.0.0, new Sync client filter variable APIs #157 See merge request objectbox/objectbox-dart!112
2 parents 9515333 + 0825b36 commit b4b5088

File tree

18 files changed

+218
-49
lines changed

18 files changed

+218
-49
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ jobs:
8282
../tool/pub.sh run test
8383
- name: Install ObjectBox C library
8484
working-directory: objectbox_test
85-
run: ../install.sh
85+
# Use Sync-enabled library to at least partially run sync_test.dart
86+
run: ../install.sh --sync
8687
- name: Library Test
8788
working-directory: objectbox_test
8889
# Set concurrency=1 to run only one test suite (== test file) at a time to make it easier to

.gitlab-ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ generator-integ-tests:
9090
- dart test --concurrency=1 --reporter expanded
9191
# ObjectBox tests
9292
- cd ../objectbox_test
93-
- ../install.sh
93+
# Use Sync-enabled library to at least partially run sync_test.dart
94+
- ../install.sh --sync
9495
- dart pub get
9596
- dart run build_runner build
9697
# Set concurrency=1 to run only one test suite (== test file) at a time.

dev-doc/updating-c-library.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ Includes database 5.0.0-2025-09-27
3737
For the Flutter plugins on Android ([view releases](https://github.com/objectbox/objectbox-java/releases)):
3838

3939
```bash
40-
./tool/set-android-version.sh 4.3.1
40+
./tool/set-android-version.sh 5.0.1
4141
```
4242

4343
```text
44-
* Update ObjectBox database for Flutter Android apps to 4.3.1.
44+
* Update ObjectBox database for Flutter Android apps to 5.0.1.
4545
If your project is [using Admin](https://docs.objectbox.io/data-browser#admin-for-android), make
46-
sure to update to `io.objectbox:objectbox-android-objectbrowser:4.3.1` in `android/app/build.gradle`.
46+
sure to update to `io.objectbox:objectbox-android-objectbrowser:5.0.1` in `android/app/build.gradle`.
4747
```
4848

4949
```text
50-
Update Android library [4.3.0 -> 4.3.1]
50+
Update Android library [4.3.1 -> 5.0.1]
5151
52-
Includes C API 4.3.1 and database 4.3.1-2025-08-02
52+
Includes C API 5.0.0 and database 5.0.0-2025-09-27
5353
```
5454

5555
Note: the embedded C API and ObjectBox version can be looked up
@@ -60,18 +60,18 @@ from the relevant objectbox repository release tag (like `java-4.1.0`).
6060
For the Flutter plugins on iOS/macOS ([view releases](https://github.com/objectbox/objectbox-swift/releases))
6161

6262
```bash
63-
./tool/set-swift-version.sh 4.4.1
63+
./tool/set-swift-version.sh 5.0.0
6464
```
6565

6666
```text
67-
* Update ObjectBox database for Flutter iOS/macOS apps to 4.3.1.
67+
* Update ObjectBox database for Flutter iOS/macOS apps to 5.0.0.
6868
For existing projects, run `pod repo update` and `pod update ObjectBox` in the `ios` or `macos` directories.
6969
```
7070

7171
```text
72-
Update macOS/iOS library [4.3.0 -> 4.4.1]
72+
Update macOS/iOS library [4.4.1 -> 5.0.0]
7373
74-
Includes C API 4.3.1 and database 4.3.1-2025-08-02
74+
Includes C API 5.0.0 and database 5.0.0-2025-09-27
7575
```
7676

7777
Note: the embedded C API and ObjectBox version can be looked up
@@ -98,5 +98,5 @@ Then manually:
9898
- Commit as
9999

100100
```text
101-
Update C-API [4.3.0 -> 4.3.1]
101+
Update C-API [4.3.1 -> 5.0.0]
102102
```

flutter_libs/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ android {
5050
// ObjectBox Android library that includes an ObjectBox C library version compatible with
5151
// the C API binding of the ObjectBox Dart package.
5252
// https://central.sonatype.com/search?q=g:io.objectbox%20objectbox-android
53-
implementation "io.objectbox:objectbox-android:4.3.1"
53+
implementation "io.objectbox:objectbox-android:5.0.1"
5454
}
5555
}

flutter_libs/ios/objectbox_flutter_libs.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
1818
s.source_files = 'Classes/**/*'
1919

2020
s.dependency 'Flutter'
21-
s.dependency 'ObjectBox', '4.4.1'
21+
s.dependency 'ObjectBox', '5.0.0'
2222

2323
# Flutter.framework does not contain a i386 slice.
2424
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }

flutter_libs/macos/objectbox_flutter_libs.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Pod::Spec.new do |s|
1818
s.source_files = 'Classes/**/*'
1919

2020
s.dependency 'FlutterMacOS'
21-
s.dependency 'ObjectBox', '4.4.1'
21+
s.dependency 'ObjectBox', '5.0.0'
2222

2323
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
2424
s.swift_version = '5.3'

objectbox/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
## latest
22

3+
### Sync
4+
5+
- Support Sync server version 5.0.
6+
- **User-Specific Data Sync**: support configuring [Sync filter](https://sync.objectbox.io/sync-server/sync-filters)
7+
variables on `SyncClient`.
8+
9+
### Other Changes
10+
311
* Flutter packages are compiled with Android SDK 35 to support Android Gradle Plugin 8.13
412
[#755](https://github.com/objectbox/objectbox-dart/issues/755). They are also built using a
513
language level of Java 11.
614
* Update ObjectBox database for Flutter Linux/Windows, Dart Native apps to [5.0.0-rc](https://github.com/objectbox/objectbox-c/releases/tag/v5.0.0-rc).
715
* ToOne relations: when deleting an object with an ID larger than the maximum 32-bit unsigned
816
integer (`4_294_967_295`) that is used as the target object of a ToOne, correctly re-set the
917
target ID of the ToOne to `0`. [#740](https://github.com/objectbox/objectbox-dart/issues/740)
18+
* Update ObjectBox database for Flutter Android apps to 5.0.1.
19+
If your project is [using Admin](https://docs.objectbox.io/data-browser#admin-for-android), make
20+
sure to update to `io.objectbox:objectbox-android-objectbrowser:5.0.1` in `android/app/build.gradle`.
21+
* Update ObjectBox database for Flutter iOS/macOS apps to 5.0.0.
22+
For existing projects, run `pod repo update` and `pod update ObjectBox` in the `ios` or `macos` directories.
23+
* Remove deprecated `contains` condition for `List<String>` properties, use `containsElement` instead.
1024

1125
## 4.3.1 (2025-09-02)
1226

objectbox/example/flutter/objectbox_demo_relations/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,5 @@ dependencies {
8383
// Add the Android library with ObjectBox Admin only for debug builds.
8484
// Note: when the objectbox package updates, check if the Android
8585
// library below needs to be updated as well.
86-
debugImplementation("io.objectbox:objectbox-android-objectbrowser:4.3.1")
86+
debugImplementation("io.objectbox:objectbox-android-objectbrowser:5.0.1")
8787
}

objectbox/lib/src/native/bindings/bindings.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ ObjectBoxC? _tryObjectBoxLibFile() {
9696
// libraries.
9797
// Library | C API | Database
9898
// ------------------------|-------|-----------------
99-
// C library 4.3.1 | 4.3.1 | 4.3.1-2025-07-28
100-
// Android library 4.3.1 | 4.3.1 | 4.3.1-2025-08-02
101-
// macOS/iOS library 4.4.1 | 4.3.1 | 4.3.1-2025-08-02
102-
var _obxCminMajor = 4;
103-
var _obxCminMinor = 3;
104-
var _obxCminPatch = 1;
99+
// C library 5.0.0-rc | 5.0.0 | 5.0.0-2025-09-27
100+
// Android library 5.0.1 | 5.0.0 | 5.0.0-2025-09-27
101+
// macOS/iOS library 5.0.0 | 5.0.0 | 5.0.0-2025-09-27
102+
var _obxCminMajor = 5;
103+
var _obxCminMinor = 0;
104+
var _obxCminPatch = 0;
105105
// Require minimum database version guaranteeing actual C API availability.
106-
var _obxDatabaseMinVersion = "4.3.1-2025-07-28";
106+
var _obxDatabaseMinVersion = "5.0.0-2025-09-27";
107107

108108
bool _isSupportedVersion(ObjectBoxC obxc) {
109109
// Require a minimum C API version

objectbox/lib/src/native/bindings/objectbox-sync.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "objectbox.h"
3535

3636
#if defined(static_assert) || defined(__cplusplus)
37-
static_assert(OBX_VERSION_MAJOR == 4 && OBX_VERSION_MINOR == 3 && OBX_VERSION_PATCH == 1, // NOLINT
37+
static_assert(OBX_VERSION_MAJOR == 5 && OBX_VERSION_MINOR == 0 && OBX_VERSION_PATCH == 0, // NOLINT
3838
"Versions of objectbox.h and objectbox-sync.h files do not match, please update");
3939
#endif
4040

@@ -201,6 +201,20 @@ OBX_C_API OBX_sync* obx_sync_urls(OBX_store* store, const char* server_urls[], s
201201
/// Stops and closes (deletes) the sync client, freeing its resources.
202202
OBX_C_API obx_err obx_sync_close(OBX_sync* sync);
203203

204+
/// Adds or replaces a sync filter variable value for the given name to the sync client.
205+
/// Eventually existing values for the same name are replaced.
206+
/// Client filter variables can be used in server-side sync filters to filter out objects that do not match the filter.
207+
/// Filter variables must be added before login, e.g. before obx_sync_start() or setting credentials.
208+
/// @param name non-NULL name of the filter variable
209+
/// @param value non-NULL value of the filter variable
210+
OBX_C_API obx_err obx_sync_filter_variables_put(OBX_sync* sync, const char* name, const char* value);
211+
212+
/// Removes a previously added sync filter variable value.
213+
OBX_C_API obx_err obx_sync_filter_variables_remove(OBX_sync* sync, const char* name);
214+
215+
/// Removes all previously added sync filter variable values.
216+
OBX_C_API obx_err obx_sync_filter_variables_remove_all(OBX_sync* sync);
217+
204218
/// Sets credentials to authenticate the client with the server.
205219
/// Any credentials that were set before are replaced;
206220
/// if you want to pass multiple credentials, use obx_sync_credentials_add() instead.

0 commit comments

Comments
 (0)