Skip to content

Commit bfc679d

Browse files
committed
0.8.1
1 parent 7179755 commit bfc679d

File tree

7 files changed

+85
-43
lines changed

7 files changed

+85
-43
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
0.8.1 (2019-12-12)
2+
------------------
3+
* Bug fix for obx_box_rel_get_ids(), which did return wrong IDs in some cases (please update!)
4+
* Several refinements on property queries, for example:
5+
* Maintain floating point point semantics on aggregates, e.g. infinity + 1 == infinity (no overflow)
6+
* Allow aggregates on Date type properties
7+
* Return negative counts if results were obtained using a short cut (API change to int64_t*)
8+
19
0.8.0 (2019-12-05)
210
------------------
311
* Property queries compute sums and averages more precisely (improved algorithms and wider types)

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.0)
22

3+
project(ObjectBoxCRoot)
4+
35
IF(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib")
46
message( FATAL_ERROR "Directory lib does not exist; please run ./download.sh first" )
57
ENDIF()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ObjectBox C API
44
Using this C API, you can us ObjectBox as an embedded database in your C/C++ application.
55
In this embedded mode, it runs within your application process.
66

7-
**Latest version: 0.8.0** (2019-12-05). See [changelog](CHANGELOG.md) for more details.
7+
**Latest version: 0.8.1** (2019-12-12). See [changelog](CHANGELOG.md) for more details.
88

99
Some features
1010
-------------

download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tty -s || quiet=true
3939

4040
# Note: optional arguments like "--quiet" shifts argument positions in the case block above
4141

42-
version=${1:-0.7.2}
42+
version=${1:-0.8.1}
4343
repoType=${2:-testing}
4444
os=${3:-$(uname)}
4545
arch=${4:-$(uname -m)}

doxygen/Changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
ObjectBox C API Changelog
44
=========================
55

6+
0.8.1 (2019-12-12)
7+
------------------
8+
* Bug fix for obx_box_rel_get_ids(), which did return wrong IDs in some cases (please update!)
9+
* Several refinements on property queries, for example:
10+
* Maintain floating point point semantics on aggregates, e.g. infinity + 1 == infinity (no overflow)
11+
* Allow aggregates on Date type properties
12+
* Return negative counts if results were obtained using a short cut (API change to int64_t*)
13+
14+
0.8.0 (2019-12-05)
15+
------------------
16+
* Property queries compute sums and averages more precisely (improved algorithms and wider types)
17+
* Property queries now consider unsigned types
18+
* Added an additional out parameter for count obx_query_prop_*()
19+
* Added put alternatives to "put" with cursor: obx_cursor_insert() and obx_cursor_update()
20+
* Added obx_query_clone() to allow clones to run in parallel on separate threads
21+
622
0.7.2 (2019-10-30)
723
------------------
824
* new obx_store_wrap() (use with Java version 2.4.1)

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "ObjectBox C API"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "0.8.0"
41+
PROJECT_NUMBER = "0.8.1"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

include/objectbox.h

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ extern "C" {
4242
/// obx_version() or obx_version_is_at_least().
4343
#define OBX_VERSION_MAJOR 0
4444
#define OBX_VERSION_MINOR 8
45-
#define OBX_VERSION_PATCH 0 // values >= 100 are reserved for dev releases leading to the next minor/major increase
45+
#define OBX_VERSION_PATCH 1 // values >= 100 are reserved for dev releases leading to the next minor/major increase
4646

4747
/// Returns the version of the library as ints. Pointers may be null.
4848
void obx_version(int* major, int* minor, int* patch);
@@ -83,7 +83,7 @@ bool obx_supports_bytes_array(void);
8383
#define OBX_ERROR_ILLEGAL_STATE 10001
8484
#define OBX_ERROR_ILLEGAL_ARGUMENT 10002
8585
#define OBX_ERROR_ALLOCATION 10003
86-
#define OBX_ERROR_OVERFLOW 10004
86+
#define OBX_ERROR_NUMERIC_OVERFLOW 10004
8787
#define OBX_ERROR_NO_ERROR_INFO 10097
8888
#define OBX_ERROR_GENERAL 10098
8989
#define OBX_ERROR_UNKNOWN 10099
@@ -968,107 +968,123 @@ OBX_query_prop* obx_query_prop(OBX_query* query, obx_schema_id property_id);
968968

969969
obx_err obx_query_prop_close(OBX_query_prop* query);
970970

971-
/// Configures the property query to work only on distinct values
971+
/// Configures the property query to work only on distinct values.
972972
/// @note not all methods support distinct, those that don't will return an error
973973
obx_err obx_query_prop_distinct(OBX_query_prop* query, bool distinct);
974974

975-
/// Configures the property query to work only on distinct values
975+
/// Configures the property query to work only on distinct values.
976+
/// This version is reserved for string properties and defines the case sensitivity for distinctness.
976977
/// @note not all methods support distinct, those that don't will return an error
978+
obx_err obx_query_prop_distinct_case(OBX_query_prop* query, bool distinct, bool case_sensitive);
979+
980+
/// Deprecated; use obx_query_prop_distinct_case() instead
977981
obx_err obx_query_prop_distinct_string(OBX_query_prop* query, bool distinct, bool case_sensitive);
978982

979983
/// Count the number of non-NULL values of the given property across all objects matching the query
980984
obx_err obx_query_prop_count(OBX_query_prop* query, uint64_t* out_count);
981985

982-
/// Calculate an average value for the given numeric property across all objects matching the query
986+
/// Calculate an average value for the given numeric property across all objects matching the query.
983987
/// @param query the query to run
984988
/// @param out_average the result of the query
985-
/// @param out_count (optional: may be NULL) number of entities contributing to the result
986-
obx_err obx_query_prop_avg(OBX_query_prop* query, double* out_average, uint64_t* out_count);
989+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
990+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
991+
/// E.g. a floating point NaN value will trigger the short cut as the average will be a NaN no matter
992+
/// what values will follow.
993+
obx_err obx_query_prop_avg(OBX_query_prop* query, double* out_average, int64_t* out_count);
987994

988-
/// Calculate an average value for the given numeric property across all objects matching the query
995+
/// Calculate an average value for the given numeric property across all objects matching the query.
989996
/// @param query the query to run
990997
/// @param out_average the result of the query
991-
/// @param out_count (optional: may be NULL) number of entities contributing to the result
992-
/// @returns OBX_ERROR_OVERFLOW if the result does not fit into an int64_t
993-
obx_err obx_query_prop_avg_int(OBX_query_prop* query, int64_t* out_average, uint64_t* out_count);
998+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
999+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1000+
/// @returns OBX_ERROR_NUMERIC_OVERFLOW if the result does not fit into an int64_t
1001+
obx_err obx_query_prop_avg_int(OBX_query_prop* query, int64_t* out_average, int64_t* out_count);
9941002

995-
/// Find the minimum value of the given floating-point property across all objects matching the query
1003+
/// Find the minimum value of the given floating-point property across all objects matching the query.
9961004
/// @param query the query to run
9971005
/// @param out_minimum the result of the query
998-
/// @param out_count (optional: may be NULL) number of entities contributing to the result; in case an index is used,
999-
/// either 0 or 1 is returned, not the actual count of entities matching the query
1000-
obx_err obx_query_prop_min(OBX_query_prop* query, double* out_minimum, uint64_t* out_count);
1006+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
1007+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1008+
/// E.g. if an index is used, it will be set to 0 or -1, instead of the actual count of objects.
1009+
obx_err obx_query_prop_min(OBX_query_prop* query, double* out_minimum, int64_t* out_count);
10011010

10021011
/// Find the maximum value of the given floating-point property across all objects matching the query
10031012
/// @param query the query to run
10041013
/// @param out_maximum the result of the query
1005-
/// @param out_count (optional: may be NULL) number of entities contributing to the result; in case an index is used,
1006-
/// either 0 or 1 is returned, not the actual count of entities matching the query
1007-
obx_err obx_query_prop_max(OBX_query_prop* query, double* out_maximum, uint64_t* out_count);
1014+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
1015+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1016+
/// E.g. if an index is used, it will be set to 0 or -1, instead of the actual count of objects.
1017+
obx_err obx_query_prop_max(OBX_query_prop* query, double* out_maximum, int64_t* out_count);
10081018

1009-
/// Calculate the sum of the given floating-point property across all objects matching the query
1019+
/// Calculate the sum of the given floating-point property across all objects matching the query.
10101020
/// @param query the query to run
10111021
/// @param out_sum the result of the query
1012-
/// @param out_count (optional: may be NULL) number of entities contributing to the result
1013-
obx_err obx_query_prop_sum(OBX_query_prop* query, double* out_sum, uint64_t* out_count);
1022+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
1023+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1024+
/// E.g. a floating point NaN value will trigger the short cut as the average will be a NaN no matter
1025+
/// what values will follow.
1026+
obx_err obx_query_prop_sum(OBX_query_prop* query, double* out_sum, int64_t* out_count);
10141027

1015-
/// Find the minimum value of the given property across all objects matching the query
1028+
/// Find the minimum value of the given property across all objects matching the query.
10161029
/// @param query the query to run
10171030
/// @param out_minimum the result of the query
1018-
/// @param out_count (optional: may be NULL) number of entities contributing to the result; in case an index is used,
1019-
/// either 0 or 1 is returned, not the actual count of entities matching the query
1020-
obx_err obx_query_prop_min_int(OBX_query_prop* query, int64_t* out_minimum, uint64_t* out_count);
1031+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
1032+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1033+
/// E.g. if an index is used, it will be set to 0 or -1, instead of the actual count of objects.
1034+
obx_err obx_query_prop_min_int(OBX_query_prop* query, int64_t* out_minimum, int64_t* out_count);
10211035

1022-
/// Find the maximum value of the given property across all objects matching the query
1036+
/// Find the maximum value of the given property across all objects matching the query.
10231037
/// @param query the query to run
10241038
/// @param out_maximum the result of the query
1025-
/// @param out_count (optional: may be NULL) number of entities contributing to the result; in case an index is used,
1026-
/// either 0 or 1 is returned, not the actual count of entities matching the query
1027-
obx_err obx_query_prop_max_int(OBX_query_prop* query, int64_t* out_maximum, uint64_t* out_count);
1039+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
1040+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1041+
/// E.g. if an index is used, it will be set to 0 or -1, instead of the actual count of objects.
1042+
obx_err obx_query_prop_max_int(OBX_query_prop* query, int64_t* out_maximum, int64_t* out_count);
10281043

1029-
/// Calculate the sum of the given property across all objects matching the query
1044+
/// Calculate the sum of the given property across all objects matching the query.
10301045
/// @param query the query to run
10311046
/// @param out_sum the result of the query
1032-
/// @param out_count (optional: may be NULL) number of entities contributing to the result
1033-
/// @returns OBX_ERROR_OVERFLOW if the result does not fit into an int64_t
1034-
obx_err obx_query_prop_sum_int(OBX_query_prop* query, int64_t* out_sum, uint64_t* out_count);
1047+
/// @param out_count (optional, may be NULL) number of objects contributing to the result (counted on the fly).
1048+
/// A negative count indicates that the computation used a short cut and thus the count is incomplete.
1049+
/// @returns OBX_ERROR_NUMERIC_OVERFLOW if the result does not fit into an int64_t
1050+
obx_err obx_query_prop_sum_int(OBX_query_prop* query, int64_t* out_sum, int64_t* out_count);
10351051

1036-
/// Returns an array of strings stored as the given property across all objects matching the query
1052+
/// Returns an array of strings stored as the given property across all objects matching the query.
10371053
/// @param value_if_null value that should be used in place of NULL values on object fields;
10381054
/// if value_if_null=NULL is given, objects with NULL values of the specified field are skipped
10391055
OBX_string_array* obx_query_prop_string_find(OBX_query_prop* query, const char* value_if_null);
10401056

1041-
/// Returns an array of ints stored as the given property across all objects matching the query
1057+
/// Returns an array of ints stored as the given property across all objects matching the query.
10421058
/// @param value_if_null value that should be used in place of NULL values on object fields;
10431059
/// if value_if_null=NULL is given, objects with NULL values of the specified are skipped
10441060
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details
10451061
OBX_int64_array* obx_query_prop_int64_find(OBX_query_prop* query, const int64_t* value_if_null);
10461062

1047-
/// Returns an array of ints stored as the given property across all objects matching the query
1063+
/// Returns an array of ints stored as the given property across all objects matching the query.
10481064
/// @param value_if_null value that should be used in place of NULL values on object fields;
10491065
/// if value_if_null=NULL is given, objects with NULL values of the specified are skipped
10501066
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details
10511067
OBX_int32_array* obx_query_prop_int32_find(OBX_query_prop* query, const int32_t* value_if_null);
10521068

1053-
/// Returns an array of ints stored as the given property across all objects matching the query
1069+
/// Returns an array of ints stored as the given property across all objects matching the query.
10541070
/// @param value_if_null value that should be used in place of NULL values on object fields;
10551071
/// if value_if_null=NULL is given, objects with NULL values of the specified are skipped
10561072
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details
10571073
OBX_int16_array* obx_query_prop_int16_find(OBX_query_prop* query, const int16_t* value_if_null);
10581074

1059-
/// Returns an array of ints stored as the given property across all objects matching the query
1075+
/// Returns an array of ints stored as the given property across all objects matching the query.
10601076
/// @param value_if_null value that should be used in place of NULL values on object fields;
10611077
/// if value_if_null=NULL is given, objects with NULL values of the specified are skipped
10621078
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details
10631079
OBX_int8_array* obx_query_prop_int8_find(OBX_query_prop* query, const int8_t* value_if_null);
10641080

1065-
/// Returns an array of doubles stored as the given property across all objects matching the query
1081+
/// Returns an array of doubles stored as the given property across all objects matching the query.
10661082
/// @param value_if_null value that should be used in place of NULL values on object fields;
10671083
/// if value_if_null=NULL is given, objects with NULL values of the specified are skipped
10681084
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details
10691085
OBX_double_array* obx_query_prop_double_find(OBX_query_prop* query, const double* value_if_null);
10701086

1071-
/// Returns an array of int stored as the given property across all objects matching the query
1087+
/// Returns an array of int stored as the given property across all objects matching the query.
10721088
/// @param value_if_null value that should be used in place of NULL values on object fields;
10731089
/// if value_if_null=NULL is given, objects with NULL values of the specified are skipped
10741090
/// @returns NULL if the operation failed, see functions like obx_last_error_code() to get error details

0 commit comments

Comments
 (0)