Skip to content

Update to database 4.3.0 #728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions dev-doc/updating-c-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,37 @@ for the binding update script (see below) and
for Flutter (`flutter_libs` and `sync_flutter_libs` plugins) on Linux and Windows:

```bash
./tool/set-c-version.sh 4.2.0
./tool/set-c-version.sh 4.3.0
```

```text
* Update ObjectBox database for Flutter Linux/Windows, Dart Native apps to [4.2.0](https://github.com/objectbox/objectbox-c/releases/tag/v4.2.0).
* Update ObjectBox database for Flutter Linux/Windows, Dart Native apps to [4.3.0](https://github.com/objectbox/objectbox-c/releases/tag/v4.3.0).
```

```text
Update C library [4.1.0 -> 4.2.0]
Update C library [4.2.0 -> 4.3.0]

Includes database 4.2.0-2025-03-04
Includes database 4.3.0-2025-05-12
```

### Android

For the Flutter plugins on Android ([view releases](https://github.com/objectbox/objectbox-java/releases)):

```bash
./tool/set-android-version.sh 4.2.0
./tool/set-android-version.sh 4.3.0
```

```text
* Update ObjectBox database for Flutter Android apps to 4.2.0.
* Update ObjectBox database for Flutter Android apps to 4.3.0.
If your project is [using Admin](https://docs.objectbox.io/data-browser#admin-for-android), make
sure to update to `io.objectbox:objectbox-android-objectbrowser:4.2.0` in `android/app/build.gradle`.
sure to update to `io.objectbox:objectbox-android-objectbrowser:4.3.0` in `android/app/build.gradle`.
```

```text
Update objectbox-android [4.1.0 -> 4.2.0]
Update Android library [4.2.0 -> 4.3.0]

Includes C API 4.2.0 and database 4.2.0-2025-03-04
Includes C API 4.3.0 and database 4.3.0-2025-05-12
```

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

```bash
./tool/set-swift-version.sh 4.2.0
./tool/set-swift-version.sh 4.3.0
```

```text
* Update ObjectBox database for Flutter iOS/macOS apps to 4.2.0.
* Update ObjectBox database for Flutter iOS/macOS apps to 4.3.0.
For existing projects, run `pod repo update` and `pod update ObjectBox` in the `ios` or `macos` directories.
```

```text
Update ObjectBox Swift [4.1.0 -> 4.2.0]
Update macOS/iOS library [4.2.0 -> 4.3.0]

Includes C API 4.2.0 and database 4.2.0-2025-03-27
Includes C API 4.3.0 and database 4.3.0-2025-05-12
```

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

```text
Update C-API [4.1.0 -> 4.2.0]
Update C-API [4.2.0 -> 4.3.0]
```
2 changes: 1 addition & 1 deletion flutter_libs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ android {
// ObjectBox Android library that includes an ObjectBox C library version compatible with
// the C API binding of the ObjectBox Dart package.
// https://central.sonatype.com/search?q=g:io.objectbox%20objectbox-android
implementation "io.objectbox:objectbox-android:4.2.0"
implementation "io.objectbox:objectbox-android:4.3.0"
}
}
2 changes: 1 addition & 1 deletion flutter_libs/ios/objectbox_flutter_libs.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'

s.dependency 'Flutter'
s.dependency 'ObjectBox', '4.2.0'
s.dependency 'ObjectBox', '4.3.0'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down
2 changes: 1 addition & 1 deletion flutter_libs/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
# ----------------------------------------------------------------------
# Download and add objectbox-c prebuilt library.

set(OBJECTBOX_VERSION 4.2.0)
set(OBJECTBOX_VERSION 4.3.0)

set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
if (${OBJECTBOX_ARCH} MATCHES "x86_64")
Expand Down
2 changes: 1 addition & 1 deletion flutter_libs/macos/objectbox_flutter_libs.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'

s.dependency 'FlutterMacOS'
s.dependency 'ObjectBox', '4.2.0'
s.dependency 'ObjectBox', '4.3.0'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.3'
Expand Down
2 changes: 1 addition & 1 deletion flutter_libs/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(objectbox_flutter_libs_bundled_libraries
# ----------------------------------------------------------------------
# Download and add objectbox-c prebuilt library.

set(OBJECTBOX_VERSION 4.2.0)
set(OBJECTBOX_VERSION 4.3.0)

set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
if (${OBJECTBOX_ARCH} MATCHES "AMD64")
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eu
# It's important that the generated dart bindings and the c-api library version match. Dart won't error on C function
# signature mismatch, leading to obscure memory bugs.
# For how to upgrade the version see dev-doc/updating-c-library.md
cLibVersion=4.2.0
cLibVersion=4.3.0
os=$(uname)
cLibArgs="$*"

Expand Down
9 changes: 9 additions & 0 deletions objectbox/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## latest

* Update ObjectBox database for Flutter Linux/Windows, Dart Native apps to [4.3.0](https://github.com/objectbox/objectbox-c/releases/tag/v4.3.0).
* Update ObjectBox database for Flutter Android apps to 4.3.0.
If your project is [using Admin](https://docs.objectbox.io/data-browser#admin-for-android), make
sure to update to `io.objectbox:objectbox-android-objectbrowser:4.3.0` in `android/app/build.gradle`.
* Update ObjectBox database for Flutter iOS/macOS apps to 4.3.0.
For existing projects, run `pod repo update` and `pod update ObjectBox` in the `ios` or `macos` directories.
* External property types (via [MongoDB connector](https://sync.objectbox.io/mongodb-sync-connector)):
add `jsonToNative` to support sub (embedded/nested) documents/arrays in MongoDB.

## 4.2.0 (2025-04-15)

* Requires at least Dart SDK 3.4 or Flutter SDK 3.22.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ dependencies {
// Add the Android library with ObjectBox Admin only for debug builds.
// Note: when the objectbox package updates, check if the Android
// library below needs to be updated as well.
debugImplementation("io.objectbox:objectbox-android-objectbrowser:4.2.0")
debugImplementation("io.objectbox:objectbox-android-objectbrowser:4.3.0")
}
13 changes: 13 additions & 0 deletions objectbox/lib/src/annotations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,19 @@ enum ExternalPropertyType {
/// Representing type: String
javaScript,

/// A JSON string that is converted to a native representation in the external
/// system.
///
/// For example, a JSON object on the ObjectBox side (string) would be
/// converted to an embedded document in MongoDB.
///
/// It depends on the external system what kind of JSON structures is
/// supported. For MongoDB, this is very flexible and allows (nested) objects,
/// arrays, primitives, etc.
///
/// Representing type: String
jsonToNative,

/// A vector (array) of Int128 values.
int128Vector,

Expand Down
9 changes: 9 additions & 0 deletions objectbox/lib/src/modelinfo/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ int externalTypeToOBXExternalType(ExternalPropertyType type) {
return OBXExternalPropertyType.Bson;
case ExternalPropertyType.javaScript:
return OBXExternalPropertyType.JavaScript;
case ExternalPropertyType.jsonToNative:
return OBXExternalPropertyType.JsonToNative;
case ExternalPropertyType.int128Vector:
return OBXExternalPropertyType.Int128Vector;
case ExternalPropertyType.uuidVector:
Expand Down Expand Up @@ -321,6 +323,13 @@ abstract class OBXExternalPropertyType {
/// Representing type: String
static const int JavaScript = 111;

/// A JSON string that is converted to a native representation in the external system.
/// For example, a JSON object on the ObjectBox side (string) would be converted to an embedded document in MongoDB.
/// It depends on the external system what kind of JSON structures is supported.
/// For MongoDB, this is very flexible and allows (nested) objects, arrays, primitives, etc.
/// Representing type: String
static const int JsonToNative = 112;

/// A vector (array) of Int128 values
static const int Int128Vector = 116;

Expand Down
10 changes: 5 additions & 5 deletions objectbox/lib/src/native/bindings/bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ ObjectBoxC? _tryObjectBoxLibFile() {
// libraries.
// Library | C API | Database
// ------------------------|-------|-----------------
// objectbox-c | 4.2.0 | 4.2.0-2025-03-04
// ObjectBox Swift 4.2.0 | 4.2.0 | 4.2.0-2025-03-27
// objectbox-android 4.2.0 | 4.2.0 | 4.2.0-2025-03-04
// C library 4.3.0 | 4.3.0 | 4.3.0-2025-05-12
// Android library 4.3.0 | 4.3.0 | 4.3.0-2025-05-12
// macOS/iOS library 4.3.0 | 4.3.0 | 4.3.0-2025-05-12
var _obxCminMajor = 4;
var _obxCminMinor = 2;
var _obxCminMinor = 3;
var _obxCminPatch = 0;
// Require minimum database version guaranteeing actual C API availability.
var _obxDatabaseMinVersion = "4.2.0-2025-03-04";
var _obxDatabaseMinVersion = "4.3.0-2025-05-12";

bool _isSupportedVersion(ObjectBoxC obxc) {
// Require a minimum C API version
Expand Down
2 changes: 1 addition & 1 deletion objectbox/lib/src/native/bindings/objectbox-sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "objectbox.h"

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

Expand Down
9 changes: 7 additions & 2 deletions objectbox/lib/src/native/bindings/objectbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extern "C" {
/// When using ObjectBox as a dynamic library, you should verify that a compatible version was linked using
/// obx_version() or obx_version_is_at_least().
#define OBX_VERSION_MAJOR 4
#define OBX_VERSION_MINOR 2
#define OBX_VERSION_MINOR 3
#define OBX_VERSION_PATCH 0 // values >= 100 are reserved for dev releases leading to the next minor/major increase

//----------------------------------------------
Expand Down Expand Up @@ -669,7 +669,12 @@ typedef enum {
/// JavaScript source code
/// Representing type: String
OBXExternalPropertyType_JavaScript = 111,
// OBXExternalPropertyType_Reserved5 = 112,
/// A JSON string that is converted to a native representation in the external system.
/// For example, a JSON object on the ObjectBox side (string) would be converted to an embedded document in MongoDB.
/// It depends on the external system what kind of JSON structures is supported.
/// For MongoDB, this is very flexible and allows (nested) objects, arrays, primitives, etc.
/// Representing type: String
OBXExternalPropertyType_JsonToNative = 112,
// OBXExternalPropertyType_Reserved6 = 113,
// OBXExternalPropertyType_Reserved7 = 114,
// OBXExternalPropertyType_Reserved8 = 115,
Expand Down
9 changes: 8 additions & 1 deletion objectbox/lib/src/native/bindings/objectbox_c.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10692,6 +10692,13 @@ abstract class OBXExternalPropertyType {
/// Representing type: String
static const int JavaScript = 111;

/// A JSON string that is converted to a native representation in the external system.
/// For example, a JSON object on the ObjectBox side (string) would be converted to an embedded document in MongoDB.
/// It depends on the external system what kind of JSON structures is supported.
/// For MongoDB, this is very flexible and allows (nested) objects, arrays, primitives, etc.
/// Representing type: String
static const int JsonToNative = 112;

/// A vector (array) of Int128 values
static const int Int128Vector = 116;

Expand Down Expand Up @@ -11669,7 +11676,7 @@ typedef obx_dart_closer

const int OBX_VERSION_MAJOR = 4;

const int OBX_VERSION_MINOR = 2;
const int OBX_VERSION_MINOR = 3;

const int OBX_VERSION_PATCH = 0;

Expand Down
4 changes: 4 additions & 0 deletions objectbox_test/test/entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ class HnswObject {
@ExternalName(name: 'my-mongo-entity')
class EntityWithExternalType {
@Id()
@ExternalType(type: ExternalPropertyType.uuid)
int id = 0;

@Property(type: PropertyType.byteVector)
Expand All @@ -490,6 +491,9 @@ class EntityWithExternalType {
@ExternalName(name: 'my-mongo-rel')
final mongoIdEntities = ToMany<EntityWithExternalType>();

@ExternalType(type: ExternalPropertyType.jsonToNative)
String? externalJsonToNative;

EntityWithExternalType(this.mongoId, this.mongoUuid);
}

Expand Down
9 changes: 8 additions & 1 deletion objectbox_test/test/objectbox-model.json
Original file line number Diff line number Diff line change
Expand Up @@ -727,14 +727,15 @@
},
{
"id": "16:5931645853908059165",
"lastPropertyId": "3:7670802129899081197",
"lastPropertyId": "4:6250975810854368520",
"name": "EntityWithExternalType",
"externalName": "my-mongo-entity",
"properties": [
{
"id": "1:3044824951282217899",
"name": "id",
"type": 6,
"externalType": 102,
"flags": 1
},
{
Expand All @@ -749,6 +750,12 @@
"type": 27,
"externalType": 102,
"externalName": "my-mongo-uuid"
},
{
"id": "4:6250975810854368520",
"name": "externalJsonToNative",
"type": 9,
"externalType": 112
}
],
"relations": [
Expand Down
2 changes: 1 addition & 1 deletion sync_flutter_libs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ android {
// ObjectBox Android library that includes an ObjectBox C library version compatible with
// the C API binding of the ObjectBox Dart package.
// https://central.sonatype.com/search?q=g:io.objectbox%20objectbox-sync-android
implementation "io.objectbox:objectbox-sync-android:4.2.0"
implementation "io.objectbox:objectbox-sync-android:4.3.0"
}
}
2 changes: 1 addition & 1 deletion sync_flutter_libs/ios/objectbox_sync_flutter_libs.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'

s.dependency 'Flutter'
s.dependency 'ObjectBox', '4.2.0-sync'
s.dependency 'ObjectBox', '4.3.0-sync'

# Flutter.framework does not contain a i386 slice.
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
Expand Down
2 changes: 1 addition & 1 deletion sync_flutter_libs/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
# ----------------------------------------------------------------------
# Download and add objectbox-c prebuilt library.

set(OBJECTBOX_VERSION 4.2.0)
set(OBJECTBOX_VERSION 4.3.0)

set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
if (${OBJECTBOX_ARCH} MATCHES "x86_64")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.source_files = 'Classes/**/*'

s.dependency 'FlutterMacOS'
s.dependency 'ObjectBox', '4.2.0-sync'
s.dependency 'ObjectBox', '4.3.0-sync'

s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
s.swift_version = '5.3'
Expand Down
2 changes: 1 addition & 1 deletion sync_flutter_libs/windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(objectbox_sync_flutter_libs_bundled_libraries
# ----------------------------------------------------------------------
# Download and add objectbox-c prebuilt library.

set(OBJECTBOX_VERSION 4.2.0)
set(OBJECTBOX_VERSION 4.3.0)

set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
if (${OBJECTBOX_ARCH} MATCHES "AMD64")
Expand Down
2 changes: 1 addition & 1 deletion tool/update-c-binding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# copies the header files, makes some required modifications
# and runs the ffigen binding generator on them.

cLibVersion=4.2.0
cLibVersion=4.3.0
echo "Downloading C library source files from GitHub..."

# Note: the release archives do not contain objectbox-dart.h, so get the full sources.
Expand Down
Loading