@@ -46,7 +46,7 @@ extern "C" {
4646/// When using ObjectBox as a dynamic library, you should verify that a compatible version was linked using
4747/// obx_version() or obx_version_is_at_least().
4848#define OBX_VERSION_MAJOR 0
49- #define OBX_VERSION_MINOR 13
49+ #define OBX_VERSION_MINOR 14
5050#define OBX_VERSION_PATCH 0 // values >= 100 are reserved for dev releases leading to the next minor/major increase
5151
5252//----------------------------------------------
@@ -996,12 +996,12 @@ obx_err obx_box_put5(OBX_box* box, obx_id id, const void* data, size_t size, OBX
996996
997997/// FB ID slot must be present in the given data; new entities must have an ID value of zero or OBX_ID_NEW.
998998/// @param data writable data buffer, which may be updated for the ID
999- /// @returns 0 on error
999+ /// @returns id if the object could be put, or 0 in case of an error
10001000obx_id obx_box_put_object (OBX_box * box , void * data , size_t size );
10011001
10021002/// FB ID slot must be present in the given data; new entities must have an ID value of zero or OBX_ID_NEW
10031003/// @param data writable data buffer, which may be updated for the ID
1004- /// @returns 0 on error, e.g. the entity was not put according to OBXPutMode
1004+ /// @returns id if the object, or 0 in case of an error, e.g. the entity was not put according to OBXPutMode
10051005obx_id obx_box_put_object4 (OBX_box * box , void * data , size_t size , OBXPutMode mode );
10061006
10071007/// Put all given objects in the database in a single transaction. If any of the individual objects failed to put,
@@ -1124,11 +1124,18 @@ obx_err obx_async_update(OBX_async* async, obx_id id, const void* data, size_t s
11241124/// Reserve an ID, which is returned immediately for future reference, and put asynchronously.
11251125/// Note: of course, it can NOT be guaranteed that the entity will actually be put successfully in the DB.
11261126/// @param data the given bytes are mutated to update the contained ID data.
1127+ /// @returns id of the new object, 0 on error
11271128obx_id obx_async_put_object (OBX_async * async , void * data , size_t size );
11281129
1130+ /// FB ID slot must be present in the given data; new entities must have an ID value of zero or OBX_ID_NEW
1131+ /// @param data writable data buffer, which may be updated for the ID
1132+ /// @returns id of the new object, 0 on error, e.g. the entity can't be put according to OBXPutMode
1133+ obx_id obx_async_put_object4 (OBX_async * async , void * data , size_t size , OBXPutMode mode );
1134+
11291135/// Reserve an ID, which is returned immediately for future reference, and insert asynchronously.
11301136/// Note: of course, it can NOT be guaranteed that the entity will actually be inserted successfully in the DB.
11311137/// @param data the given bytes are mutated to update the contained ID data.
1138+ /// @returns id of the new object, 0 on error
11321139obx_id obx_async_insert_object (OBX_async * async , void * data , size_t size );
11331140
11341141/// Remove asynchronously.
@@ -1384,6 +1391,22 @@ obx_err obx_query_limit(OBX_query* query, uint64_t limit);
13841391/// Find entities matching the query. NOTE: the returned data is only valid as long the transaction is active!
13851392OBX_bytes_array * obx_query_find (OBX_query * query );
13861393
1394+ /// Find the first object matching the query.
1395+ /// @returns OBX_NOT_FOUND if no object matches.
1396+ /// The exposed data comes directly from the OS to allow zero-copy access, which limits the data lifetime:
1397+ /// @warning Currently ignores offset, taking the the first matching element.
1398+ /// @attention The exposed data is only valid as long as the (top) transaction is still active and no write
1399+ /// operation (e.g. put/remove) was executed. Accessing data after this is undefined behavior.
1400+ obx_err obx_query_find_first (OBX_query * query , const void * * data , size_t * size );
1401+
1402+ /// Find the only object matching the query.
1403+ /// @returns OBX_NOT_FOUND if no object matches, an error if there are multiple objects matching the query.
1404+ /// The exposed data comes directly from the OS to allow zero-copy access, which limits the data lifetime:
1405+ /// @warning Currently ignores offset and limit, considering all matching elements.
1406+ /// @attention The exposed data is only valid as long as the (top) transaction is still active and no write
1407+ /// operation (e.g. put/remove) was executed. Accessing data after this is undefined behavior.
1408+ obx_err obx_query_find_unique (OBX_query * query , const void * * data , size_t * size );
1409+
13871410/// Walk over matching objects using the given data visitor
13881411obx_err obx_query_visit (OBX_query * query , obx_data_visitor * visitor , void * user_data );
13891412
0 commit comments