Skip to content

Commit 240ef76

Browse files
Merge branch 'objectbox-c-0.19' into 'main'
Update C API to 0.19 See merge request objectbox/objectbox-dart!55
2 parents ffc2fa2 + 6b0c076 commit 240ef76

File tree

24 files changed

+1746
-185
lines changed

24 files changed

+1746
-185
lines changed

dev-doc/updating-c-library.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ Dart won't error on C function signature mismatch, leading to obscure memory bug
99
Update `flutter_libs` and `sync_flutter_libs` with **compatible library versions**:
1010

1111
- Linux and Windows
12-
- Shortcut: search and replace e.g. `set(OBJECTBOX_VERSION 0.18.0)` in `CMakeLists.txt`.
12+
- Shortcut: search and replace e.g. `set(OBJECTBOX_VERSION 0.19.0)` in `CMakeLists.txt`.
1313
- [flutter_libs Linux](../flutter_libs/linux/CMakeLists.txt)
1414
- [flutter_libs Windows](../flutter_libs/windows/CMakeLists.txt)
1515
- [sync_flutter_libs Linux](../sync_flutter_libs/linux/CMakeLists.txt)
1616
- [sync_flutter_libs Windows](../sync_flutter_libs/windows/CMakeLists.txt)
1717
- Android ([view releases](https://github.com/objectbox/objectbox-java/releases))
1818
```
19-
./tool/set-android-version.sh 3.5.0
19+
./tool/set-android-version.sh 3.7.0
2020
```
2121
- Swift (iOS/macOS) ([view releases](https://github.com/objectbox/objectbox-swift/releases))
2222
```
23-
./tool/set-swift-version.sh 1.8.0
23+
./tool/set-swift-version.sh 1.9.0
2424
```
2525

2626
## Dart bindings

flutter_libs/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ android {
4646

4747
dependencies {
4848
// https://search.maven.org/search?q=g:io.objectbox%20objectbox-android
49-
implementation "io.objectbox:objectbox-android:3.5.1"
49+
implementation "io.objectbox:objectbox-android:3.7.0"
5050
}
5151
}

flutter_libs/ios/objectbox_flutter_libs.podspec

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

1616
s.dependency 'Flutter'
17-
s.dependency 'ObjectBox', '1.8.1'
17+
s.dependency 'ObjectBox', '1.9.0'
1818

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

flutter_libs/linux/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
4141
# ----------------------------------------------------------------------
4242
# Download and add objectbox-c prebuilt library.
4343

44-
set(OBJECTBOX_VERSION 0.18.1)
44+
set(OBJECTBOX_VERSION 0.19.0)
4545

4646
set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
4747
if (${OBJECTBOX_ARCH} MATCHES "x86_64")

flutter_libs/macos/objectbox_flutter_libs.podspec

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

1616
s.dependency 'FlutterMacOS'
17-
s.dependency 'ObjectBox', '1.8.1'
17+
s.dependency 'ObjectBox', '1.9.0'
1818

1919
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }
2020
s.swift_version = '5.3'

flutter_libs/windows/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ set(objectbox_flutter_libs_bundled_libraries
4747
# ----------------------------------------------------------------------
4848
# Download and add objectbox-c prebuilt library.
4949

50-
set(OBJECTBOX_VERSION 0.18.1)
50+
set(OBJECTBOX_VERSION 0.19.0)
5151

5252
set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
5353
if (${OBJECTBOX_ARCH} MATCHES "AMD64")

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eu
55
# It's important that the generated dart bindings and the c-api library version match. Dart won't error on C function
66
# signature mismatch, leading to obscure memory bugs.
77
# For how to upgrade the version see dev-doc/updating-c-library.md
8-
cLibVersion=0.18.1
8+
cLibVersion=0.19.0
99
os=$(uname)
1010
cLibArgs="$*"
1111

objectbox/CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
## latest
22

3+
* **Query support for integer and floating point lists**: For integer lists (excluding byte lists)
4+
greater, less and equal are supported on elements of the vector (e.g. "has element greater").
5+
6+
For floating point lists greater and less queries are supported on elements of the vector
7+
(e.g. "has element greater").
8+
9+
A simple example is a shape entity that stores a palette of RGB colors:
10+
```dart
11+
@Entity()
12+
class Shape {
13+
@Id()
14+
int id = 0;
15+
16+
// An array of RGB color values that are used by this shape.
17+
Int32List? palette;
18+
}
19+
20+
// Find all shapes that use red in their palette
21+
final query = store.box<Shape>()
22+
.query(Shape_.palette.equals(0xFF0000))
23+
.build();
24+
query.findIds();
25+
query.close();
26+
```
27+
* Update: [objectbox-c 0.19.0](https://github.com/objectbox/objectbox-c/releases/tag/v0.19.0).
28+
Notably now requires glibc 2.28 or higher (and GLIBCXX_3.4.25); e.g. at least **Debian Buster 10
29+
(2019) or Ubuntu 20.04**.
30+
* Update: [objectbox-swift 1.9.0](https://github.com/objectbox/objectbox-swift/releases/tag/v1.9.0).
31+
* Update: [objectbox-android 3.7.0](https://github.com/objectbox/objectbox-java/releases/tag/V3.7.0).
32+
If you are [using Admin](https://docs.objectbox.io/data-browser#setup), make sure to update to
33+
`io.objectbox:objectbox-android-objectbrowser:3.7.0`.
34+
335
## 2.2.1 (2023-08-22)
436

537
* Resolve an issue where not all query results are returned, when an entity constructor or property

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ dependencies {
8181
// Add objectbox-android-objectbrowser only for debug builds.
8282
// Warning: when objectbox_flutter_libs updates check if version
8383
// needs update, e.g. check https://github.com/objectbox/objectbox-dart/releases.
84-
debugImplementation("io.objectbox:objectbox-android-objectbrowser:3.5.1")
84+
debugImplementation("io.objectbox:objectbox-android-objectbrowser:3.7.0")
8585
}

objectbox/lib/src/modelinfo/enums.dart

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -156,50 +156,86 @@ abstract class OBXPropertyFlags {
156156

157157
/// Unique on-conflict strategy: the object being put replaces any existing conflicting object (deletes it).
158158
static const int UNIQUE_ON_CONFLICT_REPLACE = 32768;
159+
160+
/// If a date property has this flag (max. one per entity type), the date value specifies the time by which
161+
/// the object expires, at which point it MAY be removed (deleted), which can be triggered by an API call.
162+
static const int EXPIRATION_TIME = 65536;
159163
}
160164

161165
abstract class OBXPropertyType {
162-
/// < 1 byte
166+
/// < Not a actual type; represents an uninitialized or invalid type
167+
static const int Unknown = 0;
168+
169+
/// < A boolean (flag)
163170
static const int Bool = 1;
164171

165-
/// < 1 byte
172+
/// < 8-bit integer
166173
static const int Byte = 2;
167174

168-
/// < 2 bytes
175+
/// < 16-bit integer
169176
static const int Short = 3;
170177

171-
/// < 2 bytes
178+
/// < 16-bit character
172179
static const int Char = 4;
173180

174-
/// < 4 bytes
181+
/// < 32-bit integer
175182
static const int Int = 5;
176183

177-
/// < 8 bytes
184+
/// < 64-bit integer
178185
static const int Long = 6;
179186

180-
/// < 4 bytes
187+
/// < 32-bit floating point number
181188
static const int Float = 7;
182189

183-
/// < 8 bytes
190+
/// < 64-bit floating point number
184191
static const int Double = 8;
192+
193+
/// < UTF-8 encoded string (variable length)
185194
static const int String = 9;
186195

187-
/// < Unix timestamp (milliseconds since 1970) in 8 bytes
196+
/// < 64-bit (integer) timestamp; milliseconds since 1970-01-01 (unix epoch)
188197
static const int Date = 10;
198+
199+
/// < Relation to another entity
189200
static const int Relation = 11;
190201

191-
/// < Unix timestamp (nanoseconds since 1970) in 8 bytes
202+
/// < High precision 64-bit timestamp; nanoseconds since 1970-01-01 (unix epoch)
192203
static const int DateNano = 12;
193204

194205
/// < Flexible" type, which may contain scalars (integers, floating points), strings or
195206
/// < containers (lists and maps). Note: a flex map must use string keys.
196207
static const int Flex = 13;
208+
209+
/// < Variable sized vector of Bool values (note: each value is one byte)
210+
static const int BoolVector = 22;
211+
212+
/// < Variable sized vector of Byte values (8-bit integers)
197213
static const int ByteVector = 23;
214+
215+
/// < Variable sized vector of Short values (16-bit integers)
198216
static const int ShortVector = 24;
217+
218+
/// < Variable sized vector of Char values (16-bit characters)
199219
static const int CharVector = 25;
220+
221+
/// < Variable sized vector of Int values (32-bit integers)
200222
static const int IntVector = 26;
223+
224+
/// < Variable sized vector of Long values (64-bit integers)
201225
static const int LongVector = 27;
226+
227+
/// < Variable sized vector of Float values (32-bit floating point numbers)
202228
static const int FloatVector = 28;
229+
230+
/// < Variable sized vector of Double values (64-bit floating point numbers)
203231
static const int DoubleVector = 29;
232+
233+
/// < Variable sized vector of String values (UTF-8 encoded strings).
204234
static const int StringVector = 30;
235+
236+
/// < Variable sized vector of Date values (64-bit timestamp).
237+
static const int DateVector = 31;
238+
239+
/// < Variable sized vector of Date values (high precision 64-bit timestamp).
240+
static const int DateNanoVector = 32;
205241
}

0 commit comments

Comments
 (0)