Skip to content

Commit

Permalink
0.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenrobot committed Sep 4, 2023
1 parent f11e22d commit 392cf0f
Show file tree
Hide file tree
Showing 13 changed files with 368 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: objectboxio/cbuild:21.11.11-xenial
image: objectboxio/cbuild-ubuntu18.04:2023-08-23

build:
stage: build
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
ObjectBox C and C++ API Changelog
=================================

0.19.0 (2023-09-04)
-------------------
* New K/V validation option on opening the store
* Additions cursor API: get current ID, ID-based seeks (seek to first ID, seek to next ID)
* Support scalar vector types with basic queries (APIs only, no generator support)
* Various tree API improvements, e.g. introspection
* Minor API clean up: e.g. using int types for bit flags not enums
* Fixes query link condition in combination with some "or" conditions
* Fixes query "less" condition for case-sensitive strings with value indexes (default is hashed index)
* Updated Linux toolchain; now requires glibc 2.28 or higher (and GLIBCXX_3.4.25);
e.g. the following minium versions are fine: Debian Buster 10 (2019), Ubuntu 20.04, RHEL 8 (2019)
* Various internal improvements
* Sync: various additions and improvements (client and server)

0.18.1 (2023-01-30)
-------------------
Recommended bugfix release, generally recommended to update.
Expand All @@ -9,7 +23,7 @@ Recommended bugfix release, generally recommended to update.

0.18.0 (2022-10-31)
-------------------
* Date properties can now be tagged as expiration time; which can be then be easily evicted
* Date properties can now be tagged as expiration time, which can then be easily evicted
* Tree API: various additions and improvements, e.g. OBXTreeOptionFlags to configure the tree behavior
* New query condition to match objects that have a given number of relations
* New "max data size" store setting
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ else ()

function(defineObjectBoxLib VARIANT)
# Configuration updated for each release
set(DL_VERSION 0.18.1)
set(DL_VERSION 0.19.0)

# Platform detection and other setup
set(DL_URL https://github.com/objectbox/objectbox-c/releases/download)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ box.put({.text = "Buy milk"});
See [ObjectBox C and C++ docs](https://cpp.objectbox.io/) for API details.
**Latest version: 0.18.1** (2023-01-30).
**Latest version: 0.19.0** (2023-09-04).
See [changelog](CHANGELOG.md) for more details.
## Table of Contents:
Expand All @@ -28,7 +28,7 @@ See [changelog](CHANGELOG.md) for more details.
- [Examples](#examples)
- [Documentation](#documentation)
- [Current state / Changelog](#current-state--changelog)
- [Supported platforms](#supported-platforms)
- [Supported platforms](#supported-platforms)
- [C API as the Foundation for Higher Languages](#c-api-as-the-foundation-for-higher-languages)
- [Other languages/bindings](#other-languagesbindings)
- [How can I help ObjectBox?](#how-can-i-help-objectbox)
Expand Down
2 changes: 1 addition & 1 deletion download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ tty -s || quiet=true

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

version=${1:-0.18.1}
version=${1:-0.19.0}
os=${2:-$(uname)}
arch=${3:-$(uname -m)}
echo "Base config: OS ${os} and architecture ${arch}"
Expand Down
16 changes: 15 additions & 1 deletion doxygen/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
ObjectBox C and C++ API Changelog
=================================

0.19.0 (2023-09-04)
-------------------
* New K/V validation option on opening the store
* Additions cursor API: get current ID, ID-based seeks (seek to first ID, seek to next ID)
* Support scalar vector types with basic queries (APIs only, no generator support)
* Various tree API improvements, e.g. introspection
* Minor API clean up: e.g. using int types for bit flags not enums
* Fixes query link condition in combination with some "or" conditions
* Fixes query "less" condition for case-sensitive strings with value indexes (default is hashed index)
* Updated Linux toolchain; now requires glibc 2.28 or higher (and GLIBCXX_3.4.25);
e.g. the following minium versions are fine: Debian Buster 10 (2019), Ubuntu 20.04, RHEL 8 (2019)
* Various internal improvements
* Sync: various additions and improvements (client and server)

0.18.1 (2023-01-30)
-------------------
Recommended bugfix release, generally recommended to update.
Expand All @@ -11,7 +25,7 @@ Recommended bugfix release, generally recommended to update.

0.18.0 (2022-10-31)
-------------------
* Date properties can now be tagged as expiration time; which can be then be easily evicted
* Date properties can now be tagged as expiration time, which can then be easily evicted
* Tree API: various additions and improvements, e.g. OBXTreeOptionFlags to configure the tree behavior
* New query condition to match objects that have a given number of relations
* New "max data size" store setting
Expand Down
2 changes: 1 addition & 1 deletion doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "ObjectBox C and C++ API"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "0.18.1"
PROJECT_NUMBER = "0.19.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
34 changes: 17 additions & 17 deletions examples/c-cursor-no-gen/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2020 ObjectBox Ltd. All rights reserved.
* Copyright 2018-2023 ObjectBox Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -164,6 +164,7 @@ int do_action_new(OBX_store* store, int argc, char* argv[]) {
size_t size = 0;
OBX_txn* txn = NULL;
OBX_cursor* cursor = NULL;
bool success = false;

// grab the task text from the command line
if (parse_text(argc, argv, &text) <= 0) {
Expand All @@ -186,7 +187,7 @@ int do_action_new(OBX_store* store, int argc, char* argv[]) {

// Get an ID for our soon-to-be-created task entity
obx_id id = obx_cursor_id_for_put(cursor, 0);
if (!id) {
if (id == 0) {
goto clean_up;
}

Expand All @@ -199,30 +200,29 @@ int do_action_new(OBX_store* store, int argc, char* argv[]) {
if (obx_cursor_put_new(cursor, id, buff, size)) {
goto clean_up;
}
printf("New task created with ID %" PRIu64 ": %s\n", id, text);
success = true;

clean_up:
if (!obx_last_error_code()) {
printf("New task: %" PRIu64 " - %s\n", id, text);
} else {
if (!success) {
printf("Failed to create the task\n");
}
obx_err error_code = obx_last_error_code();

if (cursor) {
obx_cursor_close(cursor);
}

if (txn && !obx_last_error_code()) {
obx_txn_success(txn);
}
obx_cursor_close(cursor); // cursor may be NULL

if (txn) {
obx_txn_close(txn);
if (success && error_code == OBX_SUCCESS) {
obx_txn_success(txn);
} else {
obx_txn_close(txn);
}
}

free(text);
free(buff);

return obx_last_error_code();
return error_code;
}

//--------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -395,7 +395,7 @@ int parse_text(int argc, char** argv, char** outText) {
return -1;
}

*outText = (char*) malloc(sizeof(char) * (size_t)(size + 1));
*outText = (char*) malloc(sizeof(char) * (size_t) (size + 1));
if (!*outText) {
printf("Could not process task text\n");
return -1;
Expand Down Expand Up @@ -446,14 +446,14 @@ int task_build(void** out_buff, size_t* out_size, obx_id id, const char* text, u
return rc;
}

uint64_t timestamp_now() { return (uint64_t)(time(NULL) * 1000); }
uint64_t timestamp_now() { return (uint64_t) (time(NULL) * 1000); }

void date_to_str(char* buff, uint64_t timestamp) {
if (!timestamp) {
// empty string
buff[0] = '\0';
} else {
time_t time = (time_t)(timestamp / 1000);
time_t time = (time_t) (timestamp / 1000);
struct tm* tm_info = localtime(&time);
strftime(buff, DATE_BUFFER_LENGTH, DATE_FORMAT_STRING, tm_info);
}
Expand Down
2 changes: 1 addition & 1 deletion include/objectbox-sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "objectbox.h"

#if defined(static_assert) || defined(__cplusplus)
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 18 && OBX_VERSION_PATCH == 1, // NOLINT
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 19 && OBX_VERSION_PATCH == 0, // NOLINT
"Versions of objectbox.h and objectbox-sync.h files do not match, please update");
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/objectbox-sync.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "objectbox-sync.h"
#include "objectbox.hpp"

static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 18 && OBX_VERSION_PATCH == 1, // NOLINT
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 19 && OBX_VERSION_PATCH == 0, // NOLINT
"Versions of objectbox.h and objectbox-sync.hpp files do not match, please update");

namespace obx {
Expand Down
Loading

0 comments on commit 392cf0f

Please sign in to comment.