Giter VIP home page Giter VIP logo

objectbox-c's Introduction

ObjectBox Embedded Database for C and C++

ObjectBox is a superfast C and C++ database for embedded devices (mobile and IoT), desktop and server apps. The out-of-the-box Data Sync keeps data in sync across devices and any kind of backend/cloud reliably for occasionally connected devices. ObjectBox Data Persistence and Data Sync follows an offline-first approach and can be used on-premise as well as with a cloud setup.


Jobs: We're looking for a C++ Developer with a ❤️ for performant code


This is the ObjectBox runtime library to run ObjectBox as an embedded database in your C or C++ application.

Here's a C++ example that inserts a Task data object (a plain user defined struct) into the database:

obx::Box<Task> box(store);
box.put({.text = "Buy milk"}); 

See ObjectBox C and C++ docs for API details.

Latest version: 0.21.0 (2024-02-13). See changelog for more details.

Table of Contents:

Feature Highlights

🏁 High performance on restricted devices, like IoT gateways, micro controllers, ECUs etc.
🪂 Resourceful with minimal CPU, power and Memory usage for maximum flexibility and sustainability
🔗 Relations: object links / relationships are built-in
💻 Multiplatform: Linux, Windows, Android, iOS, macOS

🌱 Scalable: handling millions of objects resource-efficiently with ease
💐 Queries: filter data as needed, even across relations
🦮 Statically typed: compile time checks & optimizations
📃 Automatic schema migrations: no update scripts needed

And much more than just data persistence
👥 ObjectBox Sync: keeps data in sync between devices and servers
🕒 ObjectBox TS: time series extension for time based data

Some more technical details:

  • Zero-copy reads for highest possible performance; access tens of millions of objects on commodity hardware
  • Lightweight for smart devices; its binary size is only around 1 MB
  • Direct support for FlatBuffers data objects (aka "flatbuffers table")
  • Flex type to represent any FlexBuffers
  • Secondary indexes based on object properties
  • Async API for asynchronous puts, inserts, updates, removes
  • Optimized for time series data (TS edition only)
  • Data synchronization across the network (sync edition only)

Usage and Installation

In most cases you want to use the C and C++ APIs in combination with the ObjectBox Generator tool. This way, you get a convenient C or C++ API which requires minimal code on your side to work with the database.

The APIs come as single header file for C and C++:

Compile your code against it and use the binary library (.so, .dylib, .dll depending on the platform) to link against. Head over to ObjectBox C and C++ installation docs for step-by-step instructions.

C++ API

The C++ API is built on top of the C API exposed by the library (e.g. you still need objectbox.h). You can also use both APIs from your code if necessary. For example, you use the C++ obx::Box class for most database operations, but "break out" into the C API for a special function you need.
Note that to use the obx::Box class, you also need the ObjectBox Generator to generate binding code. Find more details how to use it the Getting started section of the docs.

Examples

Have a look at the following TaskList example apps, depending on your programming language and preference:

Documentation

Current state / Changelog

The C API is a thin wrapper around a robust DB core, which is version 3.x and already used on millions of devices.

Beta notice: the C API will become stable starting from version 1.0. Until then, API improvements may result in breaking changes. For example, functions may still be renamed.

Changelog: If you update from a previous version, please check the changelog. Besides new features, there may be breaking changes requiring modifications to your code.

Supported platforms:

  • Linux 64-bit
  • Linux ARMv6hf (e.g. Raspberry PI Zero)
  • Linux ARMv7hf (e.g. Raspberry PI 3/4)
  • Linux ARMv8/AArch64 (e.g. Raspberry PI 3/4 with a 64 bit OS like Ubuntu)
  • MacOS 64-bit
  • Windows 32-bit
  • Windows 64-bit

C API as the Foundation for Higher Languages

The plain C API (without the Generator) also serves as a basis for ObjectBox bindings in higher languages. For example, the official APIs for Go, Swift, Dart/Flutter and Python rely on the C API. In the same way, you could create an ObjectBox API for another programming language, e.g. for JavaScript. For the C API, data consists of bytes representing FlatBuffers tables, which you can build and read in your language of choice.

Other languages/bindings

ObjectBox supports multiple platforms and languages. Besides C/C++, ObjectBox also offers:

How can I help ObjectBox?

Let us know what you love, what you don’t, what do you want to see next?

We're looking forward to receiving your comments and requests:

  • Add GitHub issues
  • Upvote issues you find important by hitting the 👍/+1 reaction button
  • Drop us a line via @ObjectBox_io
  • ⭐ us, if you like what you see

Thank you! 🙏

Keep in touch: For general news on ObjectBox, check our blog!

License

Copyright 2018-2024 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.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

objectbox-c's People

Contributors

dan-obx avatar greenrobot avatar ivahnenkoanna avatar obx-vivien avatar vaind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

objectbox-c's Issues

Please clarify the closed source nature of this project.

The objectbox website as well as the repositories do a very good job of obfuscating the fact that objectbox is a closed source product. Please make this clear in the binding repos and on the site. It is very misleading.

I had to search through closed issues to find the answer.

error:no matching function for call to 'obx::Box<Task>::put(<brace-enclosed initializer list>)

when I compile the example by running: g++ main.cpp -I. -std=c++11 -lobjectbox
error:no matching function for call to 'obx::Box::put()

obx_id id = box.put({.text = "Buy milk"})
^

int main()
{
obx::Store store(create_obx_model());
obx::Box box(store);

obx_id id = box.put({.text = "Buy milk"});  //  error code

std::unique_ptr task = box.get(id); // Read
if (task) {
task->text += " & some bread";
box.put(*task); // Update
box.remove(id); // Delete
}
return 0;
}

to-one and to-many relations

Hi,
Unfortunately, there is no explanation about relations in ObjectBox documentation for c++ .
Please explain how we should use to-one and to-many relations in ObjectBox c++ ?
Thanks

erro try to run first objectbox c++ code

Describe the bug
hello guys.
this the first time i am using objectbox with c++ that give me that error :

  • i try to add objectbox.dll to system32 but not work

Basic info (please complete the following information):

  • ObjectBox version: latest
  • version: [ C++: 20 ,cmake :3.8]
  • OS: windows 21h2

To Reproduce
See error

Code

#include "main.h"
#include "objectbox.hpp"
#include "objectbox-model.h"
#include "task.obx.hpp"
#include "stdio.h"
using namespace std;

int main()
{
printf("Using ObjectBox version %s\n", obx_version_string());

obx::Store store(create_obx_model());

return
0
}

Logs, stack traces
Severity Code Description Project File Line Suppression State Details
Error LNK1120 4 unresolved externals C:\Users\myPc\source\repos\pro_one\out\build\x64-debug\pro_one C:\Users\myPc\source\repos\pro_one\out\build\x64-debug\pro_one.exe 1

Synchonization

Is the c/c++ library going to get synchronization any time soon?

v0.20.0.tar.gz seems to be almost same as v0.19.0.tar.gz

Describe the bug
A lots of files in v0.20.0.tar.gz are same as those in v0.19.0.tar.gz

Basic info (please complete the following information):

  • ObjectBox version: 0.20.0
  • C or C++ version: C++20
  • Reproducibility: always
  • OS: Fedora 39

To Reproduce
Steps to reproduce the behavior:

  1. get v0.20.0.tar.gz from github
  2. cmake -S .
  3. cmake --build build
  4. cmake gets 0.19.0 so file

Expected behavior
cmake gets 0.20.0 so file.

undefined reference errors after following manual

Dear ObjectboxTeam,
i tried setting up ObjectBox for c++ as told in the manual.
After changing CmakeLists.txt to find the library i now keep getting undefined reference errors

  • ObjectBox version: [0.17.0]
  • C++ version: [20](i reproduced the error on different standards as well.)
  • OS: [linux mint]
  • IDE [CLion]

This is my Cmakelists.txt

cmake_minimum_required(VERSION 3.22)
project(objectboxtest)

set(CMAKE_CXX_STANDARD 20)

include(FetchContent)
FetchContent_Declare(
        objectbox
        GIT_REPOSITORY https://github.com/objectbox/objectbox-c.git
        GIT_TAG        v0.17.0
)

FetchContent_MakeAvailable(objectbox)

include_directories(cmake-build-debug/_deps/objectbox-sync-download-src/include)

FetchContent_Declare(
        flatbuffers
        GIT_REPOSITORY https://github.com/google/flatbuffers.git
        GIT_TAG        v2.0.0
)

FetchContent_MakeAvailable(flatbuffers)

file(COPY ${CMAKE_BINARY_DIR}/_deps/flatbuffers-src/include/flatbuffers
        DESTINATION "_deps/objectbox-sync-download-src/include/")

add_executable(objectboxtest main.cpp main.h objectbox-model.h tasklist.obx.cpp tasklist.obx.hpp)

target_link_libraries(objectbox INTERFACE objectbox)

And this is the error i keep getting

====================[ Build | objectboxtest | Debug ]===========================
/opt/clion-2022.1.3/bin/cmake/linux/bin/cmake --build /home/jonas/CLionProjects/objectboxtest/cmake-build-debug --target objectboxtest -j 1
[1/1] Linking CXX executable objectboxtest
FAILED: objectboxtest 
: && /usr/bin/g++ -g  CMakeFiles/objectboxtest.dir/main.cpp.o CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o -o objectboxtest   && :
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::(anonymous namespace)::throwLastError(int)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:78: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:81: undefined reference to `obx_last_error_message'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:86: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::(anonymous namespace)::checkErrOrThrow(int)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:94: undefined reference to `obx_last_error_code'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::(anonymous namespace)::CursorTx::~CursorTx()':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:532: undefined reference to `obx_cursor_close'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::(anonymous namespace)::idVectorOrThrow(OBX_id_array*)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:569: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:578: undefined reference to `obx_id_array_free'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:581: undefined reference to `obx_id_array_free'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::(anonymous namespace)::QCGroup::applyTo(OBX_query_builder*, bool) const':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:697: undefined reference to `obx_qb_any'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:698: undefined reference to `obx_qb_all'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `create_obx_model':
/home/jonas/CLionProjects/objectboxtest/objectbox-model.h:23: undefined reference to `obx_model'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:26: undefined reference to `obx_model_entity'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:27: undefined reference to `obx_model_property'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:28: undefined reference to `obx_model_property_flags'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:29: undefined reference to `obx_model_property'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:30: undefined reference to `obx_model_property'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:31: undefined reference to `obx_model_property_flags'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:32: undefined reference to `obx_model_property'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:33: undefined reference to `obx_model_property_flags'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:34: undefined reference to `obx_model_entity_last_property_id'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/objectbox-model.h:36: undefined reference to `obx_model_last_entity_id'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `OBX_store_options* obx::(anonymous namespace)::checkPtrOrThrow<OBX_store_options>(OBX_store_options*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `OBX_store* obx::(anonymous namespace)::checkPtrOrThrow<OBX_store>(OBX_store*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `OBX_txn* obx::(anonymous namespace)::checkPtrOrThrow<OBX_txn>(OBX_txn*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `OBX_cursor* obx::(anonymous namespace)::checkPtrOrThrow<OBX_cursor>(OBX_cursor*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `OBX_box* obx::(anonymous namespace)::checkPtrOrThrow<OBX_box>(OBX_box*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Options::Options()':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:152: undefined reference to `obx_opt'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Options::~Options()':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:159: undefined reference to `obx_opt_free'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Options::model(OBX_model*)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:164: undefined reference to `obx_opt_model'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Store::Store(obx::Options&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:404: undefined reference to `obx_store_open'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Transaction::Transaction(obx::Store&, obx::TxMode)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:462: undefined reference to `obx_txn_write'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:462: undefined reference to `obx_txn_read'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Transaction::closeNoThrow()':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:500: undefined reference to `obx_txn_close'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::(anonymous namespace)::CursorTx::CursorTx(obx::TxMode, obx::Store&, unsigned int)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:521: undefined reference to `obx_cursor'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Store::~Store()':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:2192: undefined reference to `obx_store_close'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Box<Task>::Box(obx::Store&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:1652: undefined reference to `obx_box'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Box<Task>::put(Task const&, OBXPutMode)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:1795: undefined reference to `obx_box_put_object4'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:1797: undefined reference to `obx_last_error_code'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Box<Task>::remove(unsigned long)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:1844: undefined reference to `obx_box_remove'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/main.cpp.o: in function `obx::Box<Task>::get(unsigned long, Task&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:1721: undefined reference to `obx_cursor_get'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `obx::(anonymous namespace)::throwLastError(int)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:78: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:81: undefined reference to `obx_last_error_message'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:86: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `obx::(anonymous namespace)::checkErrOrThrow(int)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:94: undefined reference to `obx_last_error_code'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `obx::(anonymous namespace)::idVectorOrThrow(OBX_id_array*)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:569: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:578: undefined reference to `obx_id_array_free'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:581: undefined reference to `obx_id_array_free'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `obx::(anonymous namespace)::QCGroup::applyTo(OBX_query_builder*, bool) const':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:697: undefined reference to `obx_qb_any'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:698: undefined reference to `obx_qb_all'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `OBX_store_options* obx::(anonymous namespace)::checkPtrOrThrow<OBX_store_options>(OBX_store_options*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `OBX_store* obx::(anonymous namespace)::checkPtrOrThrow<OBX_store>(OBX_store*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `OBX_txn* obx::(anonymous namespace)::checkPtrOrThrow<OBX_txn>(OBX_txn*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
/usr/bin/ld: CMakeFiles/objectboxtest.dir/tasklist.obx.cpp.o: in function `OBX_cursor* obx::(anonymous namespace)::checkPtrOrThrow<OBX_cursor>(OBX_cursor*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_code'
/usr/bin/ld: /home/jonas/CLionProjects/objectboxtest/cmake-build-debug/_deps/objectbox-sync-download-src/include/objectbox.hpp:105: undefined reference to `obx_last_error_message'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Thank you very much in advance.
Jonas

Is there any tool to investigate or browse the database created by objectbox, no matter gui or cli

When I develop some application with the objectbox lib, I hope to have a separate tool to verify the records (objects) saved in the database, somthing like that for SQLite, to browse and lookup what table(entities) and records existed in current database file.

I have glanced at the repos in github.com/objectbox, but not found such a tool. Compare to 'objectject-generator` as pre-build tool, such a post-browse tool is also useful.

Maybe it is possible to write one using objectbox lib, while I think it is so common requirement, I wonder is there any project already provides such tool.

flatbuffers.h does not found when compiling

🚨 First, please check:

Describe the bug
When I add include and lib to the project in windows and using Visual Studio 2013 to compile it I get an error which says it could not find "flatbuffers/flatbuffers.h"

Basic info (please complete the following information):

  • ObjectBox version: [e.g. 0.18.0-windows-x64, latest version?]
  • C or C++ version: [e.g. C++11, Visual Studio 2013]
  • Reproducibility: [always]
  • OS: [Windows 10]

To Reproduce
Steps to reproduce the behavior:
Just try to compile the code in a Visual C++ project.
Expected behavior
A clear and concise description of what you expected to happen.
Just I would like it to compile.
Code
If applicable, add code to help explain your problem.

  • Include affected entity code.
  • Please remove any unnecessary or confidential parts.
  • At best, link to or attach a project with a failing test.

Logs, stack traces
If applicable, add relevant logs, or a stack trace.

Additional context
Add any other context about the problem here.

  • Is there anything special about your code?
  • May transactions or multi-threading play a role?
  • Did you find any workarounds to prevent the issue?

Ability to change filename extension -- MDB conflicts with MS Access (MDB)

Start with a clear and concise description of what problem you are trying to solve.

  • When saving the database, it creates [objectbox] directory with files *.mdb
  • I'm on Windows platform, MDB extension is claimed by MS Access. Customers could accidentally double-click and Access would start, and then say 'unrecognized database format'.

A clear and concise description of what you want to happen.

  • I would like to rename the extension to something else. A custom extension, possible?

Describe alternatives you've considered

  • No idea. There's no way to rename extension?

Add any other context (e.g. platform or language) about the feature request here.

  • I need ability to change extension, change directory in-code, ability to save/load/close the database collection.

Readme has wrong link for generated C

The readme file Examples section has this link text:

C, with generated code - plain C, using code generated by objectbox-generator

But it links to the cpp-gen/ directory instead of the c-gen/ directory.

Clarification on Android/iOS use

I'd love to use ObjectBox in a multi-platform Android/iOS app (C++, QT/QML stack), as it looks to be pretty much perfect for my use case. But. It is unclear to me if that is supported - the main library/project says that it is, but the C/C++ wrapper does not mention so, and there are no binaries on the releases page for Android or iOS.

There's #4, but in the replies, it is not clear to me what "Android APIs also include the C interface" means. Am I supposed to get the Java jars from the gradle repository, and those would expose the C interface?

So effectively, this is both a question, as well as a request for clarification in the readme/releases if ObjectBox can be used from Android and iOS. If yes, then a tutorial/tips on how to do so, would be very much appreciated.

'Skipped low-level close of cursor' after re-creating transaction

If I re-create transaction for same table right after previous is closed, I always get warning [WARN ] Skipped low-level close of cursor (write, TX #xxx alive). Imagine there is following code:

auto txn = obx_txn_begin(store);
auto cursor = obx_cursor_create(txn, 1);
obx_cursor_put(cursor, <something>);
obx_cursor_close(cursor);
obx_txn_close(txn);
txn = obx_txn_begin(store);
cursor = obx_cursor_create(txn, 1);

I will produce this warning unless there will be timeout before starting second transaction. I believe there should be convenience function to wait for transaction is completed for this case.

Better docs

Hi,

I think that you can improve the docs with these topics:

  1. More complete and complex examples
  2. Relation one-to-many
  3. Relation one-to-one
  4. Storing date/time
  5. Storing float/double
  6. More complex queries (the examples in docs are too simple)
  7. About indexes (if exists)
  8. Full text-search
  9. Queries with date/time
  10. Date/time are stored as UTC timestamp?
  11. How to work with Multi-thread?
  12. Recovery after corruption file (it exists?)

Thanks.

coredump for double free to run example (win10 WSL)

Describe the bug
When I try the example c-cursor-no-gen, it is success to insert a new task, but print a coredump error in the end.

Basic info (please complete the following information):

  • ObjectBox version: 0.18.0
  • C or C++ version: c
  • Reproducibility: always
  • OS: Win10 WSL

To Reproduce

gdb information as following:

tanshuil@B013741:~/github/lymslive/lyObjectBox/build/_deps/objectbox-build/examples/c-cursor-no-gen$ gdb ./objectbox-c-examples-tasks
gdb: /usr/local/lib/libuuid.so.1: no version information available (required by /lib/x86_64-linux-gnu/libbabeltrace-ctf.so.1)
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./objectbox-c-examples-tasks...
(No debugging symbols found in ./objectbox-c-examples-tasks)
(gdb) r buy more milk
Starting program: /home/tanshuil/github/lymslive/lyObjectBox/build/_deps/objectbox-build/examples/c-cursor-no-gen/objectbox-c-examples-tasks buy more milk
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Using libobjectbox version 0.18.0, core version: 3.4.0-2022-10-31 (tree)
New task: 2 - buy more milk
free(): double free detected in tcache 2

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fffff462859 in __GI_abort () at abort.c:79
#2  0x00007fffff4cd29e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fffff5f7298 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007fffff4d532c in malloc_printerr (str=str@entry=0x7fffff5f95d0 "free(): double free detected in tcache 2") at malloc.c:5347
#4  0x00007fffff4d6f9d in _int_free (av=0x7fffff62cb80 <main_arena>, p=0x8029a50, have_lock=0) at malloc.c:4201
#5  0x00007fffff6e6627 in obx_txn_close () from /home/tanshuil/github/lymslive/lyObjectBox/build/_deps/objectbox-download-src/lib/libobjectbox.so
#6  0x0000000008005b5c in do_action_new ()
#7  0x00000000080057f9 in main ()
(gdb)

support armv7 (not armv7hf)

Hello, objectbox:
We have a device that not support hard-float, but we really want to use objectbox. Can you please provide shared library or static library for armv7? Thank you very much.
( The chip on our device is Hi3516, and the system is linux.

Prebuilt Libraries for Android

Hi, I am working on an Android NDK project which will use objectbox-c. Can you provide prebuilt libraries for Android as well in addition to the following?

  • Linux::x86_64
  • Linux::armv6
  • Linux::armv7
  • Windows::x86
  • Windows::x86_64
  • Macos::x86_64

The database file seems to have a limit of 1G, thens throws an exception when trying to put more objects

Describe the bug
I just test transfer large data from another database to objectbox, where each record has about 3000 fields.
When I have put about 40000 records into objectbox, and the file objectbox/data.mdb reach about 1GB size, then it refuse to put any more new object.

Throw obx::DbException with wath() message: Could not put.
And print Storage error(code -30792)

Basic info (please complete the following information):

  • ObjectBox version: latest version 0.18.0
  • C++11, gcc 4.8.5
  • OS: centos 7.9

Could not open database environment; please check options and file system

Describe the bug
Could not create ObjectBox - please check configuration: Could not open database environment; please check options and file system (13) [recovered]

Basic info (please complete the following information):

  • ObjectBox version: [latest version]
  • C or C++ version: [unknown]
  • Reproducibility: [always]
  • OS: [Window10]

To Reproduce
Steps to reproduce the behavior:
go test

Expected behavior

Code
Logs, stack traces

panic: Could not create ObjectBox - please check configuration: Could not open database environment; please check options and file system (13) [recovered]
        panic: Could not create ObjectBox - please check configuration: Could not open database environment; please check options and file system (13)

goroutine 51 [running]:
testing.tRunner.func1(0xc00012e700)
        /usr/lib/go-1.13/src/testing/testing.go:874 +0x3a3
panic(0x665820, 0xc000200540)
        /usr/lib/go-1.13/src/runtime/panic.go:679 +0x1b2
github.com/objectbox/objectbox-go/objectbox.(*Builder).Build(0xc00021c4c0, 0xc0002047e0, 0xc00021c4c0, 0x0)
        /home/ihbing/go/pkg/mod/github.com/objectbox/[email protected]/objectbox/builder.go:133 +0xdc
souobjectboxparser/objectboxparser.initObjectBox(0xc00012b600, 0x12, 0xc000220000)
        /mnt/f/task/soul/src/souobjectboxparser/objectboxparser/objectboxparser.go:66 +0xa6
souobjectboxparser/objectboxparser.ParseMDBData(0xc000220000, 0x1d000, 0x1d200, 0x0, 0x0)
        /mnt/f/task/soul/src/souobjectboxparser/objectboxparser/objectboxparser.go:34 +0x158
souobjectboxparser/objectboxparser.Start()
        /mnt/f/task/soul/src/souobjectboxparser/objectboxparser/objectboxparser.go:17 +0xc5
souobjectboxparser/objectboxparser.TestStart(0xc00012e700)
        /mnt/f/task/soul/src/souobjectboxparser/objectboxparser/objectboxparser_test.go:6 +0x20
testing.tRunner(0xc00012e700, 0x6e7ee0)
        /usr/lib/go-1.13/src/testing/testing.go:909 +0xc9
created by testing.(*T).Run
        /usr/lib/go-1.13/src/testing/testing.go:960 +0x350
exit status 2

Additional context

compile ObjectBox without examples

I'm looking to compile ObjectBox without including the examples and test apps. Essentially, I want to keep only the ObjectBox library in my environment.

It would be great if you could consider adding an option to remove examples when using the FetchContent_MakeAvailable command.

This way, users would have the flexibility to exclude example programs from the build process, reducing unnecessary build time and keeping the project clean and concise

[question] - database storage and size limits

hello team,
first, thanks for providing us this nice framework, it's really interesting to work with.

then, I have 2 questions, maybe it's a dumb ones:

  1. technically, how big a database can be in storage? GBs? TBs?
  2. one of my intentions is to store files inside the database, probably as a byte array. is there any recommended way for this? (performance related question);

that's all for now.
Thank you very much ^^

Ross.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.