Skip to content

Commit ad3bcce

Browse files
committed
0.15.0
1 parent 5ab1a43 commit ad3bcce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+6457
-4359
lines changed

CHANGELOG.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,31 @@
11
ObjectBox C and C++ API Changelog
22
=================================
33

4-
0.14.0 (2021-05-13)
4+
0.15.0 (2021-12-09)
55
-------------------
6+
* New "Flex" data type that can contain data of various types like integers, floating points, strings, lists and maps
7+
* New query conditions for Flex lists to find a specific element
8+
* New query conditions for Flex maps to find elements with a specific key or key/value pair
9+
* New unique on-conflict strategy: replace conflicting objects (OBXPropertyFlags_UNIQUE_ON_CONFLICT_REPLACE)
10+
* New functions to attach to existing stores using only the file path (in the same process)
11+
* New APIs for ObjectBox Admin, the web based UI (formerly known as Object Browser): obx_admin_*
12+
* Minor performance improvements for indexed access
13+
* Major performance improvements for tree/GraphQL queries
14+
* ARM binaries are now built for minimal size reducing the library size significantly
15+
* New "no_reader_thread_locals" store option
16+
* Enable debug logging (requires a special build)
17+
* API: Type for query offsets and limits was changed from uint64_t to size_t
18+
* API: rarely used obx_txn_mark_success() was removed; use obx_txn_success()
19+
* API: feature checks consolidated to only use obx_has_feature()
20+
* Many internal improvements
21+
* Core version 3.0.1-2021-12-09
22+
23+
### Sync
24+
25+
* New API for embedded server mode: obx_sync_server_* (implementation available on request)
626

27+
0.14.0 (2021-05-13)
28+
-------------------
729
* change `obx_query_prop_count()` to respect case-sensitivity setting when counting distinct strings
830
* change `OBXSyncCredentialsType` values to start at 1
931
* add `obx_query_find_first()` to get a first object matching the query
@@ -14,7 +36,6 @@ ObjectBox C and C++ API Changelog
1436

1537
0.13.0 (2021-03-16)
1638
-------------------
17-
1839
* add Sync binary library variants for all supported platforms
1940
* add MacOS universal binary library, supporting Intel x64 and Apple Silicon arm64
2041
* split Sync symbols out of objectbox.h/pp into objectbox-sync.h/pp

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ else ()
3131

3232
function(defineObjectBoxLib VARIANT)
3333
# Configuration updated for each release
34-
set(DL_VERSION 0.14.0)
34+
set(DL_VERSION 0.15.0)
3535

3636
# Platform detection and other setup
3737
set(DL_URL https://github.com/objectbox/objectbox-c/releases/download)

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ box.put({.text = "Buy milk"});
1111
1212
See [ObjectBox C and C++ docs](https://cpp.objectbox.io/) for API details.
1313
14-
**Latest version: 0.14.0** (2021-05-13).
14+
**Latest version: 0.15.0** (2021-12-09).
1515
See [changelog](CHANGELOG.md) for more details.
1616
1717
Feature Highlights
@@ -31,8 +31,8 @@ And some more technical details:
3131
3232
* Zero-copy reads for highest possible performance; access tens of millions of objects on commodity hardware
3333
* Lightweight for smart devices; its binary size is only around 1 MB
34-
(special feature reduced versions with 1/3 - 1/2 size are available on request)
35-
* Direct support for [FlatBuffers](https://google.github.io/flatbuffers/) data objects (aka "flatbuffers table")
34+
* Direct support for [FlatBuffers](https://google.github.io/flatbuffers/) data objects (aka "flatbuffers table")
35+
* Flex type to represent any FlexBuffers
3636
* Secondary indexes based on object properties
3737
* Async API for asynchronous puts, inserts, updates, removes
3838
* Optimized Time series types (TS edition only)
@@ -77,7 +77,7 @@ Documentation
7777
7878
Current state / Changelog
7979
-------------------------
80-
The C API is a thin wrapper around a robust DB core, which is version 2.x and already used on millions of devices.
80+
The C API is a thin wrapper around a robust DB core, which is version 3.x and already used on millions of devices.
8181
8282
**Beta notice:** the C API will become stable starting from version 1.0.
8383
Until then, API improvements may result in breaking changes. For example, functions may still be renamed.

download.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tty -s || quiet=true
4444

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

47-
version=${1:-0.14.0}
47+
version=${1:-0.15.0}
4848
os=${2:-$(uname)}
4949
arch=${3:-$(uname -m)}
5050
echo "Base config: OS ${os} and architecture ${arch}"

doxygen/Changelog.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,31 @@
33
ObjectBox C and C++ API Changelog
44
=================================
55

6-
0.14.0 (2021-05-13)
6+
0.15.0 (2021-12-09)
77
-------------------
8+
* New "Flex" data type that can contain data of various types like integers, floating points, strings, lists and maps
9+
* New query conditions for Flex lists to find a specific element
10+
* New query conditions for Flex maps to find elements with a specific key or key/value pair
11+
* New unique on-conflict strategy: replace conflicting objects (OBXPropertyFlags_UNIQUE_ON_CONFLICT_REPLACE)
12+
* New functions to attach to existing stores using only the file path (in the same process)
13+
* New APIs for ObjectBox Admin, the web based UI (formerly known as Object Browser): obx_admin_*
14+
* Minor performance improvements for indexed access
15+
* Major performance improvements for tree/GraphQL queries
16+
* ARM binaries are now built for minimal size reducing the library size significantly
17+
* New "no_reader_thread_locals" store option
18+
* Enable debug logging (requires a special build)
19+
* API: Type for query offsets and limits was changed from uint64_t to size_t
20+
* API: rarely used obx_txn_mark_success() was removed; use obx_txn_success()
21+
* API: feature checks consolidated to only use obx_has_feature()
22+
* Many internal improvements
23+
* Core version 3.0.1-2021-12-09
24+
25+
### Sync
26+
27+
* New API for embedded server mode: obx_sync_server_* (implementation available on request)
828

29+
0.14.0 (2021-05-13)
30+
-------------------
931
* change `obx_query_prop_count()` to respect case-sensitivity setting when counting distinct strings
1032
* change `OBXSyncCredentialsType` values to start at 1
1133
* add `obx_query_find_first()` to get a first object matching the query
@@ -16,7 +38,6 @@ ObjectBox C and C++ API Changelog
1638

1739
0.13.0 (2021-03-16)
1840
-------------------
19-
2041
* add Sync binary library variants for all supported platforms
2142
* add MacOS universal binary library, supporting Intel x64 and Apple Silicon arm64
2243
* split Sync symbols out of objectbox.h/pp into objectbox-sync.h/pp

doxygen/Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "ObjectBox C and 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.14.0"
41+
PROJECT_NUMBER = "0.15.0"
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

examples/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
add_subdirectory(c-cursor-no-gen)
22
add_subdirectory(c-gen)
33
add_subdirectory(cpp-gen)
4+
add_subdirectory(cpp-gen-sync)

examples/cpp-gen-sync/CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# C++ sync-enabled client example
2+
set(PROJECT_NAME objectbox-c-examples-tasks-cpp-gen-sync)
3+
project(${PROJECT_NAME} CXX)
4+
add_executable(${PROJECT_NAME}
5+
main.cpp
6+
tasklist.obx.cpp
7+
)
8+
set_target_properties(${PROJECT_NAME} PROPERTIES
9+
CXX_STANDARD 11
10+
CXX_STANDARD_REQUIRED YES
11+
)
12+
target_link_libraries(${PROJECT_NAME} objectbox)
13+
target_include_directories(${PROJECT_NAME} PRIVATE ../../include ../../external)

examples/cpp-gen-sync/main.cpp

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Copyright 2018-2020 ObjectBox Ltd. All rights reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "tasklist-example-app.hpp"
18+
19+
#include "objectbox-sync.hpp"
20+
21+
using namespace obx;
22+
23+
int main(int argc, char* argv[]) {
24+
// this example expect sync-server to be running locally
25+
std::string syncServerURL = "ws://127.0.0.1:9999";
26+
27+
std::cout << "This is a simple example of a ObjectBox Sync client application." << std::endl
28+
<< "To execute this example yourself, you need to start a sync-server locally:" << std::endl
29+
<< " ./sync-server --model objectbox-model.json -d server-db --unsecured-no-authentication"
30+
<< " --bind " + syncServerURL << std::endl
31+
<< "Note: update the --model argument path to the model file from this example directory." << std::endl
32+
<< "You can launch multiple instances of this program in parallel in two windows, each with" << std::endl
33+
<< "a separate database by starting each with a different `--directory dirname` argument." << std::endl
34+
<< "The clients automatically connect to the sync-server (URL specified in main-sync.cpp)." << std::endl
35+
<< "See sync in action: create tasks on one client and refresh the list on the other." << std::endl;
36+
std::cout << "---------------------------------------------------------------------------------------" << std::endl;
37+
38+
// create_obx_model() provided by objectbox-model.h
39+
// obx interface contents provided by objectbox.hpp
40+
Store::Options storeOptions(create_obx_model());
41+
42+
if (int err = processArgs(argc, argv, storeOptions)) {
43+
return err;
44+
}
45+
46+
Store store(storeOptions);
47+
48+
// Note: server is expected to be set up with no authentication for this demo
49+
std::shared_ptr<SyncClient> client = Sync::client(store, syncServerURL, SyncCredentials::none());
50+
client->start();
51+
52+
TasklistCmdlineApp app(store);
53+
return app.run();
54+
}
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Code generated by ObjectBox; DO NOT EDIT.
2+
3+
#pragma once
4+
5+
#ifdef __cplusplus
6+
#include <cstdbool>
7+
#include <cstdint>
8+
extern "C" {
9+
#else
10+
#include <stdbool.h>
11+
#include <stdint.h>
12+
#endif
13+
#include "objectbox.h"
14+
15+
/// Initializes an ObjectBox model for all entities.
16+
/// The returned pointer may be NULL if the allocation failed. If the returned model is not NULL, you should check if
17+
/// any error occurred by calling obx_model_error_code() and/or obx_model_error_message(). If an error occurred, you're
18+
/// responsible for freeing the resources by calling obx_model_free().
19+
/// In case there was no error when setting the model up (i.e. obx_model_error_code() returned 0), you may configure
20+
/// OBX_store_options with the model by calling obx_opt_model() and subsequently opening a store with obx_store_open().
21+
/// As soon as you call obx_store_open(), the model pointer is consumed and MUST NOT be freed manually.
22+
static inline OBX_model* create_obx_model() {
23+
OBX_model* model = obx_model();
24+
if (!model) return NULL;
25+
26+
obx_model_entity(model, "Task", 1, 6645479796472661392);
27+
obx_model_entity_flags(model, OBXEntityFlags_SYNC_ENABLED);
28+
obx_model_property(model, "id", OBXPropertyType_Long, 1, 9211738071025439652);
29+
obx_model_property_flags(model, OBXPropertyFlags_ID);
30+
obx_model_property(model, "text", OBXPropertyType_String, 2, 8804670454579230281);
31+
obx_model_property(model, "date_created", OBXPropertyType_Date, 4, 1260602348787983453);
32+
obx_model_property_flags(model, OBXPropertyFlags_UNSIGNED);
33+
obx_model_property(model, "date_finished", OBXPropertyType_Date, 5, 6240065879507520219);
34+
obx_model_property_flags(model, OBXPropertyFlags_UNSIGNED);
35+
obx_model_entity_last_property_id(model, 5, 6240065879507520219);
36+
37+
obx_model_last_entity_id(model, 1, 6645479796472661392);
38+
return model; // NOTE: the returned model will contain error information if an error occurred.
39+
}
40+
41+
#ifdef __cplusplus
42+
}
43+
#endif
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
3+
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
4+
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
5+
"entities": [
6+
{
7+
"id": "1:6645479796472661392",
8+
"lastPropertyId": "5:6240065879507520219",
9+
"name": "Task",
10+
"flags": 2,
11+
"properties": [
12+
{
13+
"id": "1:9211738071025439652",
14+
"name": "id",
15+
"type": 6,
16+
"flags": 1
17+
},
18+
{
19+
"id": "2:8804670454579230281",
20+
"name": "text",
21+
"type": 9
22+
},
23+
{
24+
"id": "4:1260602348787983453",
25+
"name": "date_created",
26+
"type": 10,
27+
"flags": 8192
28+
},
29+
{
30+
"id": "5:6240065879507520219",
31+
"name": "date_finished",
32+
"type": 10,
33+
"flags": 8192
34+
}
35+
]
36+
}
37+
],
38+
"lastEntityId": "1:6645479796472661392",
39+
"lastIndexId": "",
40+
"lastRelationId": "",
41+
"modelVersion": 5,
42+
"modelVersionParserMinimum": 5,
43+
"retiredEntityUids": [],
44+
"retiredIndexUids": [],
45+
"retiredPropertyUids": [
46+
6707341922395832766
47+
],
48+
"retiredRelationUids": [],
49+
"version": 1
50+
}

0 commit comments

Comments
 (0)