You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/dev-tools-and-debugging.mdx
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,16 @@ description: >-
5
5
information.
6
6
---
7
7
8
+
importTabsfrom"@theme/Tabs"
9
+
importTabItemfrom"@theme/TabItem"
10
+
11
+
12
+
8
13
# Dev Tools and Debugging
9
14
15
+
ObjectBox has tools that help during development. Learn more about looking at data inside the database and how to enable debug logs for additional information.
16
+
17
+
10
18
## Database Viewer
11
19
12
20
[ObjectBox Admin](https://docs.objectbox.io/data-browser) is a web-app that can be used to view inside the ObjectBox database. Since it is available as a Docker container with a developer-friendly front-end script you can use it right from a developer console to get insights into your database.\
@@ -24,11 +32,11 @@ Starting server on http://0.0.0.0:8081
24
32
25
33
Opening the URL `http://localhost:8081` with your browser will open the ObjectBox Admin UI:
See [ObjectBox Admin](https://docs.objectbox.io/data-browser) Documentation for further details and to download developer-friendly front-end launcher shell script.
31
-
{% endhint %}
39
+
:::
32
40
33
41
## Logging
34
42
@@ -60,13 +68,12 @@ $ ./build/myapp
60
68
[..]
61
69
```
62
70
63
-
{% hint style="info" %}
71
+
:::info
64
72
See [C API Documentation of OBXDebugFlag](https://objectbox.io/docfiles/c/current/group\_\_c.html#gade842fb1271541e05f848925f32efa9d) for a list of available debug flags. 
65
-
{% endhint %}
73
+
:::
66
74
67
-
{% hint style="info" %}
75
+
:::info
68
76
ObjectBox also offers a **DebugLog** which gives insights at a very detail level. This is typically not used by an application end-user but might be helpful when things go wrong or when developing improvements, enhancements and features. \
69
77
\
70
78
This feature is not available in the public release but on request.
Copy file name to clipboardExpand all lines: website/docs/entity-annotations.mdx
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,23 @@ description: >-
4
4
persist entities with entity annotations in this tutorial section.
5
5
---
6
6
7
+
importTabsfrom"@theme/Tabs"
8
+
importTabItemfrom"@theme/TabItem"
9
+
10
+
11
+
7
12
# Entity Annotations
8
13
14
+
ObjectBox database persistence for C and C++ is based on objects. Learn how to persist entities with entity annotations in this tutorial section.
15
+
16
+
9
17
The source FlatBuffer schema can contain some ObjectBox-specific annotations, declared as specially formatted comments to `table` and `field` FlatBuffer schema elements. 
10
18
11
19
## Annotated schema example
12
20
13
21
Have a look at the following FlatBuffers schema example showing some ObjectBox annotations:
14
22
15
-
{% code title="schema.fbs" %}
16
-
```
23
+
```fbs title="schema.fbs"
17
24
/// This entity is not annotated and serves as a relation target in this example
18
25
table Simple {
19
26
id:ulong;
@@ -48,19 +55,11 @@ table SharedInfo {
48
55
...
49
56
}
50
57
```
51
-
{% endcode %}
52
58
53
59
## Annotation format
54
-
55
60
To ensure that the annotations are recognized, follow these guidelines:
56
61
57
-
* Must be a comment immediately preceding an Entity or a Property (no empty lines between them).
58
-
* The comment must start with three slashes so it's picked up by FlatBuffer schema parser as a "documentation".
59
-
* Spaces between words inside the comment are skipped so you can use them for better readability if you like. See e.g. `Annotated`, `time`.
60
-
* The comment must start with the text `objectbox:` and is followed by one or more annotations, separated by commas.
61
-
* Each annotation has a name and some annotations also support specifying a value (some even require a value, e.g. the `name` annotation). See e.g. `Annotated`, `relId`.
62
-
* Value, if present, is added to the annotation by adding an equal sign and the actual value.
63
-
* A value may additionally be surrounded by double quotes but it's not necessary. See e.g. `fullName` showing both variants.
62
+
64
63
65
64
## Supported annotations
66
65
@@ -73,7 +72,7 @@ The following annotations are currently supported:
73
72
***uid** - used to explicitly specify UID used with this entity; used when renaming entities. See [Schema changes](schema-changes.md) for more details.
74
73
***relation** - adds a standalone (many-to-many) relation, usually to another entity. Example: creating a relation to the authors of a book: `objectbox:relation(name=authors,to=Author)`
75
74
***sync** - enables synchronization for the entity - only relevant with [ObjectBox Sync](https://objectbox.io/sync/) library builds. Entities not marked with this annotation will not be synchronized to the server, i.e. they're local-only.
76
-
*`sync(sharedGlobalIds)` can be used to switch from the default behaviour (ID-mapping) to using a global ID space. This flag tells ObjectBox to treat object IDs globally and thus no ID mapping (local <-> global) is performed. Often this is used with `id(assignable)` annotation and some special ID scheme.
75
+
*`sync(sharedGlobalIds)` can be used to switch from the default behaviour (ID-mapping) to using a global ID space. This flag tells ObjectBox to treat object IDs globally and thus no ID mapping (local `<->` global) is performed. Often this is used with `id(assignable)` annotation and some special ID scheme.
77
76
78
77
### **Property annotations**
79
78
@@ -91,4 +90,4 @@ The following annotations are currently supported:
91
90
***name** - specifies the name to use in the database if it's desired to be different than what the FlatBuffer schema "field" is called.
92
91
***transient** - this property is skipped, no code is generated for it. Useful if you have custom FlatBuffer handling but still want to generate ObjectBox binding code for the entity.
93
92
***uid** - used to explicitly specify UID used with this property; used when renaming properties. See [Schema changes](schema-changes.md) for more details.
94
-
***unique** - set to enforce that values are unique before an entity is inserted/updated. A `put` operation will abort and return an error if the unique constraint is violated.
93
+
***unique** - set to enforce that values are unique before an entity is inserted/updated. A `put` operation will abort and return an error if the unique constraint is violated.
Copy file name to clipboardExpand all lines: website/docs/faq.mdx
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,16 @@
2
2
description: Frequently asked questions about ObjectBox C and C++.
3
3
---
4
4
5
+
importTabsfrom"@theme/Tabs"
6
+
importTabItemfrom"@theme/TabItem"
7
+
8
+
9
+
5
10
# FAQ
6
11
12
+
Frequently asked questions about ObjectBox C and C++.
13
+
14
+
7
15
## How do I distribute ObjectBox?
8
16
9
17
Don't forget to bundle the dynamic library (so/dylib/dll) with your program when distributing/packaging for a installer. Having the library in the same directory as your program binary should be enough for Windows. For other system, you might need to ensure the installation library to the system directory (`usr/lib` or `/usr/local/lib`) or one of the paths specified in`LD_LIBRARY_PATH`(Linux) or`DYLD_LIBRARY_PATH`(macOS).
@@ -14,4 +22,4 @@ Symptoms: error messages like "Could not put", "Storage error(code -30792)" indi
14
22
15
23
The 1 GB limit is a default, which can be changed via options. In C++ there's an `Option` class for that and in C there are `obx_opt_*()` functions. These options have to be prepared before opening the store.
16
24
17
-
To increase the DB limit, use [`obx::Options::maxDbSizeInKb(uint64_t sizeInKb)`](https://objectbox.io/docfiles/c/current/classobx\_1\_1Options.html#a1e18dbe2cc14998827b265dcc2956994) in C++. For C, it's [`obx_opt_max_db_size_in_kb(OBX_store_options *opt, uint64_t size_in_kb)`](https://objectbox.io/docfiles/c/current/group\_\_c.html#ga1a334d11e5a989ae3195c56a5bf0a3ea).
25
+
To increase the DB limit, use [`obx::Options::maxDbSizeInKb(uint64_t sizeInKb)`](https://objectbox.io/docfiles/c/current/classobx\_1\_1Options.html#a1e18dbe2cc14998827b265dcc2956994) in C++. For C, it's [`obx_opt_max_db_size_in_kb(OBX_store_options *opt, uint64_t size_in_kb)`](https://objectbox.io/docfiles/c/current/group\_\_c.html#ga1a334d11e5a989ae3195c56a5bf0a3ea).
Copy file name to clipboardExpand all lines: website/docs/generator.mdx
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,19 +4,27 @@ description: >-
4
4
ObjectBox.
5
5
---
6
6
7
+
importTabsfrom"@theme/Tabs"
8
+
importTabItemfrom"@theme/TabItem"
9
+
10
+
11
+
7
12
# Generator
8
13
9
-
{% hint style="info" %}
14
+
This is the reference guide on the ObjectBox Generator, a build-time tool for ObjectBox.
15
+
16
+
17
+
:::info
10
18
For an intro to the generator, see also the [installation guide](installation.md#objectbox-generator) and [Generating Binding Code](getting-started.md#generating-binding-code).
11
-
{% endhint %}
19
+
:::
12
20
13
21
When using ObjectBox within your project, you typically need two things: the runtime library and the the build-time ObjectBox Generator. The generator takes a data model (see [Entity Annotations](entity-annotations.md)) as input and generates `struct`s, a data model representation as code and additional glue code for a tight and fast integration of your individual data types and the ObjectBox API.
14
22
15
23
If you are using CMake, it's highly recommended to use the CMake integration of the ObjectBox Generator. For all other setups, triggering the generator in [standalone mode](generator.md#standalone) is also supported.
16
24
17
-
{% hint style="info" %}
25
+
:::info
18
26
The ObjectBox Generator binary is currently not available for Linux/Windows ARM architectures (pull requests are welcome). The macOS as universal binary supports ARM64 and AMD64 architectures.
19
-
{% endhint %}
27
+
:::
20
28
21
29
## CMake Integration
22
30
@@ -87,9 +95,9 @@ The CMake module is implicitly downloaded together with objectbox shared librari
87
95
\
88
96
The latest version of the find module is also available from [https://raw.githubusercontent.com/objectbox/objectbox-generator/main/cmake/FindObjectBoxGenerator.cmake](https://raw.githubusercontent.com/objectbox/objectbox-generator/main/cmake/FindObjectBoxGenerator.cmake)
89
97
90
-
{% hint style="info" %}
98
+
:::info
91
99
Automatic download of ObjectBox-Generator executables can be disabled via CMake Option `OBX_GENERATOR_ALLOW_FETCH` set to `FALSE`.
92
-
{% endhint %}
100
+
:::
93
101
94
102
The generator repository provides a CMake find module for `find_package` .
0 commit comments