@@ -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.
4848void 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
969969obx_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
973973obx_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
977981obx_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
980984obx_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
10391055OBX_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
10451061OBX_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
10511067OBX_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
10571073OBX_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
10631079OBX_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
10691085OBX_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