Skip to content
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# In development
* Update to objectbox-c 0.10.0.
* Update to objectbox-android 2.7.1.
* Update to objectbox-swift 1.4.0.
* String startsWith and endsWith condition: removed unused `descending` parameter, add `caseSensitive` parameter.
* String greaterThan/lessThan condition: `withEqual` is deprecated, use the greaterOrEqual/lessOrEqual condition instead.
* Query find/findIds `offset` and `limit` parameters are deprecated, set them using the equally named methods instead.

0.7.0 (2020-08-14)
------------------
* Flutter v1.20 support
Expand Down
2 changes: 1 addition & 1 deletion flutter_libs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ android {

dependencies {
// https://github.com/objectbox/objectbox-java/releases
implementation "io.objectbox:objectbox-android:2.5.1"
implementation "io.objectbox:objectbox-android:2.7.1"
}
2 changes: 1 addition & 1 deletion flutter_libs/ios/download-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail
# NOTE: run this script before publishing

# https://github.com/objectbox/objectbox-swift/releases/
obxSwiftVersion="1.3.0"
obxSwiftVersion="1.4.0"

dir=$(dirname "$0")

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eu
# https://github.com/objectbox/objectbox-c/releases
# Warning: ensure C lib signature changes are reflected in lib/src/bindings/signatures.dart
# Dart won't error if they do not match, it may lead to obscure memory bugs.
cLibVersion=0.8.2
cLibVersion=0.10.0
os=$(uname)

# if there's no tty this is probably part of a docker build - therefore we install the c-api explicitly
Expand Down
213 changes: 124 additions & 89 deletions lib/src/bindings/bindings.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'dart:ffi';
import 'dart:io' show Platform;

import 'package:ffi/ffi.dart';

import 'signatures.dart';
import 'structs.dart';

Expand Down Expand Up @@ -93,7 +95,7 @@ class _ObjectBoxBindings {
obx_box_ids_for_put;
int Function(
Pointer<Void> box, int id, Pointer<Uint8> data, int size, int mode)
obx_box_put;
obx_box_put5;
int Function(Pointer<Void> box, Pointer<OBX_bytes_array> objects,
Pointer<Uint64> ids, int mode) obx_box_put_many;
int Function(Pointer<Void> box, int id) obx_box_remove;
Expand All @@ -115,31 +117,37 @@ class _ObjectBoxBindings {

obx_qb_cond_operator_0_dart_t obx_qb_null, obx_qb_not_null;

obx_qb_cond_operator_1_dart_t<int> obx_qb_int_equal,
obx_qb_int_not_equal,
obx_qb_int_greater,
obx_qb_int_less;
obx_qb_cond_operator_1_dart_t<int> obx_qb_equals_int,
obx_qb_not_equals_int,
obx_qb_greater_than_int,
obx_qb_less_than_int;

obx_qb_cond_operator_2_dart_t<int> obx_qb_int_between;
obx_qb_cond_operator_2_dart_t<int> obx_qb_between_2ints;

obx_qb_cond_operator_in_dart_t<Int64> obx_qb_int64_in, obx_qb_int64_not_in;
obx_qb_cond_operator_in_dart_t<Int32> obx_qb_int32_in, obx_qb_int32_not_in;
obx_qb_cond_operator_in_dart_t<Int64> obx_qb_in_int64s, obx_qb_not_in_int64s;
obx_qb_cond_operator_in_dart_t<Int32> obx_qb_in_int32s, obx_qb_not_in_int32s;

obx_qb_cond_string_op_1_dart_t obx_qb_string_equal,
obx_qb_string_not_equal,
obx_qb_string_contains,
obx_qb_string_starts_with,
obx_qb_string_ends_with;
obx_qb_cond_string_op_1_dart_t obx_qb_equals_string,
obx_qb_not_equals_string,
obx_qb_contains_string,
obx_qb_starts_with_string,
obx_qb_ends_with_string,
obx_qb_greater_than_string,
obx_qb_greater_or_equal_string,
obx_qb_less_than_string,
obx_qb_less_or_equal_string;

obx_qb_cond_operator_1_dart_t<double> obx_qb_double_greater,
obx_qb_double_less;
obx_qb_cond_operator_2_dart_t<double> obx_qb_double_between;
obx_qb_cond_operator_1_dart_t<double> obx_qb_greater_than_double,
obx_qb_less_than_double;
obx_qb_cond_operator_2_dart_t<double> obx_qb_between_2doubles;

obx_qb_string_lt_gt_op_dart_t obx_qb_string_greater, obx_qb_string_less;
obx_qb_string_in_dart_t obx_qb_string_in;
obx_qb_string_in_dart_t obx_qb_in_strings;

obx_qb_bytes_eq_dart_t obx_qb_bytes_equal;
obx_qb_bytes_lt_gt_dart_t obx_qb_bytes_greater, obx_qb_bytes_less;
obx_qb_cond_bytes_dart_t obx_qb_equals_bytes,
obx_qb_greater_than_bytes,
obx_qb_greater_or_equal_bytes,
obx_qb_less_than_bytes,
obx_qb_less_or_equal_bytes;

obx_qb_join_op_dart_t obx_qb_all, obx_qb_any;

Expand All @@ -150,6 +158,10 @@ class _ObjectBoxBindings {
// query
obx_query_t obx_query_create;
obx_query_close_dart_t obx_query_close;

obx_query_offset_dart_t obx_query_offset;
obx_query_limit_dart_t obx_query_limit;

obx_query_find_t<int> obx_query_find;
obx_query_find_ids_t<int> obx_query_find_ids;

Expand Down Expand Up @@ -178,19 +190,19 @@ class _ObjectBoxBindings {
obx_query_prop_sum_int;

obx_query_prop_find_native_t<Pointer<OBX_string_array>, Int8>
obx_query_prop_string_find;
obx_query_prop_find_strings;
obx_query_prop_find_native_t<Pointer<OBX_int64_array>, Int64>
obx_query_prop_int64_find;
obx_query_prop_find_int64s;
obx_query_prop_find_native_t<Pointer<OBX_int32_array>, Int32>
obx_query_prop_int32_find;
obx_query_prop_find_int32s;
obx_query_prop_find_native_t<Pointer<OBX_int16_array>, Int16>
obx_query_prop_int16_find;
obx_query_prop_find_int16s;
obx_query_prop_find_native_t<Pointer<OBX_int8_array>, Int8>
obx_query_prop_int8_find;
obx_query_prop_find_int8s;
obx_query_prop_find_native_t<Pointer<OBX_double_array>, Double>
obx_query_prop_double_find;
obx_query_prop_find_doubles;
obx_query_prop_find_native_t<Pointer<OBX_float_array>, Float>
obx_query_prop_float_find;
obx_query_prop_find_floats;

// Utilities
obx_bytes_array_t<int> obx_bytes_array;
Expand Down Expand Up @@ -340,7 +352,7 @@ class _ObjectBoxBindings {
_fn<obx_box_id_for_put_native_t>('obx_box_id_for_put').asFunction();
obx_box_ids_for_put =
_fn<obx_box_ids_for_put_native_t>('obx_box_ids_for_put').asFunction();
obx_box_put = _fn<obx_box_put_native_t>('obx_box_put').asFunction();
obx_box_put5 = _fn<obx_box_put_native_t>('obx_box_put5').asFunction();
obx_box_put_many =
_fn<obx_box_put_many_native_t>('obx_box_put_many').asFunction();
obx_box_remove =
Expand Down Expand Up @@ -369,80 +381,98 @@ class _ObjectBoxBindings {
obx_qb_not_null =
_fn<obx_qb_cond_operator_0_native_t>('obx_qb_not_null').asFunction();

obx_qb_int_equal =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_int_equal')
// Integer conditions
obx_qb_equals_int =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_equals_int')
.asFunction();
obx_qb_int_not_equal =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_int_not_equal')
obx_qb_not_equals_int =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_not_equals_int')
.asFunction();
obx_qb_int_greater =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_int_greater')
obx_qb_greater_than_int =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_greater_than_int')
.asFunction();
obx_qb_int_less =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_int_less')
obx_qb_less_than_int =
_fn<obx_qb_cond_operator_1_native_t<Int64>>('obx_qb_less_than_int')
.asFunction();

obx_qb_int_between =
_fn<obx_qb_cond_operator_2_native_t<Int64>>('obx_qb_int_between')
obx_qb_between_2ints =
_fn<obx_qb_cond_operator_2_native_t<Int64>>('obx_qb_between_2ints')
.asFunction();

obx_qb_int64_in =
_fn<obx_qb_cond_operator_in_native_t<Int64>>('obx_qb_int64_in')
obx_qb_in_int64s =
_fn<obx_qb_cond_operator_in_native_t<Int64>>('obx_qb_in_int64s')
.asFunction();
obx_qb_int64_not_in =
_fn<obx_qb_cond_operator_in_native_t<Int64>>('obx_qb_int64_not_in')
obx_qb_not_in_int64s =
_fn<obx_qb_cond_operator_in_native_t<Int64>>('obx_qb_not_in_int64s')
.asFunction();

obx_qb_int32_in =
_fn<obx_qb_cond_operator_in_native_t<Int32>>('obx_qb_int32_in')
obx_qb_in_int32s =
_fn<obx_qb_cond_operator_in_native_t<Int32>>('obx_qb_in_int32s')
.asFunction();
obx_qb_int32_not_in =
_fn<obx_qb_cond_operator_in_native_t<Int32>>('obx_qb_int32_not_in')
obx_qb_not_in_int32s =
_fn<obx_qb_cond_operator_in_native_t<Int32>>('obx_qb_not_in_int32s')
.asFunction();

obx_qb_string_equal =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_string_equal')
// String conditions
obx_qb_equals_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_equals_string')
.asFunction();
obx_qb_string_not_equal =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_string_not_equal')
obx_qb_not_equals_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_not_equals_string')
.asFunction();
obx_qb_string_contains =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_string_contains')
obx_qb_contains_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_contains_string')
.asFunction();

obx_qb_string_starts_with =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_string_starts_with')
obx_qb_starts_with_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_starts_with_string')
.asFunction();
obx_qb_string_ends_with =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_string_ends_with')
obx_qb_ends_with_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_ends_with_string')
.asFunction();

obx_qb_string_greater =
_fn<obx_qb_string_lt_gt_op_native_t>('obx_qb_string_greater')
obx_qb_greater_than_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_greater_than_string')
.asFunction();
obx_qb_greater_or_equal_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_greater_or_equal_string')
.asFunction();
obx_qb_less_than_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_less_than_string')
.asFunction();
obx_qb_less_or_equal_string =
_fn<obx_qb_cond_string_op_1_native_t>('obx_qb_less_or_equal_string')
.asFunction();
obx_qb_string_less =
_fn<obx_qb_string_lt_gt_op_native_t>('obx_qb_string_less').asFunction();

obx_qb_string_in =
_fn<obx_qb_string_in_native_t>('obx_qb_string_in').asFunction();
obx_qb_in_strings =
_fn<obx_qb_string_in_native_t>('obx_qb_in_strings').asFunction();

obx_qb_double_greater =
_fn<obx_qb_cond_operator_1_native_t<Double>>('obx_qb_double_greater')
.asFunction();
obx_qb_double_less =
_fn<obx_qb_cond_operator_1_native_t<Double>>('obx_qb_double_less')
// Floating point conditions (double)
obx_qb_greater_than_double = _fn<obx_qb_cond_operator_1_native_t<Double>>(
'obx_qb_greater_than_double')
.asFunction();
obx_qb_less_than_double =
_fn<obx_qb_cond_operator_1_native_t<Double>>('obx_qb_less_than_double')
.asFunction();

obx_qb_double_between =
_fn<obx_qb_cond_operator_2_native_t<Double>>('obx_qb_double_between')
obx_qb_between_2doubles =
_fn<obx_qb_cond_operator_2_native_t<Double>>('obx_qb_between_2doubles')
.asFunction();

obx_qb_bytes_equal =
_fn<obx_qb_bytes_eq_native_t>('obx_qb_bytes_equal').asFunction();
obx_qb_bytes_greater =
_fn<obx_qb_bytes_lt_gt_native_t>('obx_qb_bytes_greater').asFunction();
obx_qb_bytes_less =
_fn<obx_qb_bytes_lt_gt_native_t>('obx_qb_bytes_less').asFunction();
// Bytes (blob) conditions (currently unused)
obx_qb_equals_bytes =
_fn<obx_qb_cond_bytes_native_t>('obx_qb_equals_bytes').asFunction();
obx_qb_greater_than_bytes =
_fn<obx_qb_cond_bytes_native_t>('obx_qb_greater_than_bytes')
.asFunction();
obx_qb_greater_or_equal_bytes =
_fn<obx_qb_cond_bytes_native_t>('obx_qb_greater_or_equal_bytes')
.asFunction();
obx_qb_less_than_bytes =
_fn<obx_qb_cond_bytes_native_t>('obx_qb_less_than_bytes').asFunction();
obx_qb_less_or_equal_bytes =
_fn<obx_qb_cond_bytes_native_t>('obx_qb_less_or_equal_bytes')
.asFunction();

obx_qb_all = _fn<obx_qb_join_op_native_t>('obx_qb_all').asFunction();
obx_qb_any = _fn<obx_qb_join_op_native_t>('obx_qb_any').asFunction();
Expand All @@ -457,6 +487,11 @@ class _ObjectBoxBindings {
obx_query_close =
_fn<obx_query_close_native_t>('obx_query_close').asFunction();

obx_query_offset =
_fn<obx_query_offset_native_t>('obx_query_offset').asFunction();
obx_query_limit =
_fn<obx_query_offset_native_t>('obx_query_limit').asFunction();

obx_query_find_ids =
_fn<obx_query_find_ids_t<Uint64>>('obx_query_find_ids').asFunction();
obx_query_find =
Expand Down Expand Up @@ -513,33 +548,33 @@ class _ObjectBoxBindings {
_fn<obx_query_prop_op_t<Int32, Int64>>('obx_query_prop_sum_int')
.asFunction();

obx_query_prop_string_find =
obx_query_prop_find_strings =
_fn<obx_query_prop_find_native_t<Pointer<OBX_string_array>, Int8>>(
'obx_query_prop_string_find')
'obx_query_prop_find_strings')
.asFunction();
obx_query_prop_int64_find =
obx_query_prop_find_int64s =
_fn<obx_query_prop_find_native_t<Pointer<OBX_int64_array>, Int64>>(
'obx_query_prop_int64_find')
'obx_query_prop_find_int64s')
.asFunction();
obx_query_prop_int32_find =
obx_query_prop_find_int32s =
_fn<obx_query_prop_find_native_t<Pointer<OBX_int32_array>, Int32>>(
'obx_query_prop_int32_find')
'obx_query_prop_find_int32s')
.asFunction();
obx_query_prop_int16_find =
obx_query_prop_find_int16s =
_fn<obx_query_prop_find_native_t<Pointer<OBX_int16_array>, Int16>>(
'obx_query_prop_int16_find')
'obx_query_prop_find_int16s')
.asFunction();
obx_query_prop_int8_find =
obx_query_prop_find_int8s =
_fn<obx_query_prop_find_native_t<Pointer<OBX_int8_array>, Int8>>(
'obx_query_prop_int8_find')
'obx_query_prop_find_int8s')
.asFunction();
obx_query_prop_double_find =
obx_query_prop_find_doubles =
_fn<obx_query_prop_find_native_t<Pointer<OBX_double_array>, Double>>(
'obx_query_prop_double_find')
'obx_query_prop_find_doubles')
.asFunction();
obx_query_prop_float_find =
obx_query_prop_find_floats =
_fn<obx_query_prop_find_native_t<Pointer<OBX_float_array>, Float>>(
'obx_query_prop_float_find')
'obx_query_prop_find_floats')
.asFunction();

// Utilities
Expand Down
Loading