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/entity-annotations.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ The following annotations are currently supported:
69
69
70
70
***name** - specifies the name to use in the database if it's desired to be different than what the FlatBuffer schema "table" is called.
71
71
***transient** - this entity is skipped, no code is generated for it. Useful if you have custom FlatBuffer handling but still want to generate ObjectBox binding code for some parts of the same file.
72
-
***uid** - used to explicitly specify UID used with this entity; used when renaming entities. See [Schema changes](schema-changes.md) for more details.
72
+
***uid** - used to explicitly specify UID used with this entity; used when renaming entities. See [Schema changes](schema-changes) for more details.
73
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)`
74
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.
75
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.
@@ -89,5 +89,5 @@ The following annotations are currently supported:
89
89
***relation** - declares the field as a relation ID, linking to another Entity which must be specified as a value of this annotation.
90
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.
91
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.
92
-
***uid** - used to explicitly specify UID used with this property; used when renaming properties. See [Schema changes](schema-changes.md) for more details.
92
+
***uid** - used to explicitly specify UID used with this property; used when renaming properties. See [Schema changes](schema-changes) for more details.
93
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/generator.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,12 +15,12 @@ This is the reference guide on the ObjectBox Generator, a build-time tool for Ob
15
15
16
16
17
17
:::info
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).
18
+
For an intro to the generator, see also the [installation guide](installation#objectbox-generator) and [Generating Binding Code](getting-started#generating-binding-code).
19
19
:::
20
20
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.
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)) 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.
22
22
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.
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#standalone) is also supported.
24
24
25
25
:::info
26
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.
@@ -32,7 +32,7 @@ The ObjectBox Generator is well integrated into CMake. 
32
32
33
33
Enabling the Generator via CMake
34
34
35
-
Once you have the ObjectBox runtime library set up via `FetchContent` (see [installation](installation.md)), it only takes one more command to enable the Generator:
35
+
Once you have the ObjectBox runtime library set up via `FetchContent` (see [installation](installation)), it only takes one more command to enable the Generator:
36
36
37
37
```cmake
38
38
# Note: downloads automatically if not found locally
@@ -91,7 +91,7 @@ By default, generated files (except the model JSON file) are written relative to
91
91
92
92
### Details on finding the CMake module
93
93
94
-
The CMake module is implicitly downloaded together with objectbox shared libraries as described in [Installation](installation.md).\
94
+
The CMake module is implicitly downloaded together with objectbox shared libraries as described in [Installation](installation).\
95
95
\
96
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)
Copy file name to clipboardExpand all lines: website/docs/getting-started.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ ObjectBox Generator produces binding code for ObjectBox C & C++ APIs. This great
18
18
### Generating binding code
19
19
20
20
:::info
21
-
ObjectBox Generator is a tool, which must be [downloaded separately](https://github.com/objectbox/objectbox-generator/releases). For details, please check the [installation](installation.md) page.
21
+
ObjectBox Generator is a tool, which must be [downloaded separately](https://github.com/objectbox/objectbox-generator/releases). For details, please check the [installation](installation) page.
22
22
:::
23
23
24
24
ObjectBox Generator uses FlatBuffer schema file (.fbs) as its primary input. The Generator also maintains some metadata around the data model in a JSON file (objectbox-model.json). Based on these two files, it generates code for the selected language (C or C++). 
@@ -52,7 +52,7 @@ The following files will be generated:
52
52
* tasklist.obx.cpp
53
53
54
54
:::info
55
-
See [#cmake-support](generator.md#cmake-support"mention")for details on CMake integration.
55
+
See [#cmake-support](generator#cmake-support"mention")for details on CMake integration.
56
56
:::
57
57
58
58
</TabItem>
@@ -233,7 +233,7 @@ handle_error: // print error and clean up
233
233
234
234
If you've followed the installation instructions, you should be able to compile the example
235
235
236
-
If you are using CMake, like shown in the [installation section](installation.md#cmake-3.14), just add the generated `tasklist.obx.cpp` file to the `myapp` target.
236
+
If you are using CMake, like shown in the [installation section](installation#cmake-3.14), just add the generated `tasklist.obx.cpp` file to the `myapp` target.
237
237
238
238
The `add_executable` call in the CMake file now looks like this:
The command snippet assumes you have [the libraries installed](installation.md) in a path recognized by your OS (e.g. /usr/local/lib/) and all the referenced headers are in the same folder alongside the main.c/.cpp file.
266
+
The command snippet assumes you have [the libraries installed](installation) in a path recognized by your OS (e.g. /usr/local/lib/) and all the referenced headers are in the same folder alongside the main.c/.cpp file.
267
267
:::
268
268
269
269
Wherever you have access to a Box, you can use it to persist objects and fetch objects from disk. **Boxes are thread-safe.** Here are some of the basic operations, have a look at the objectbox.h(pp) for more:
If you want to use an ObjectBox Sync variant of the library, change the `target_link_libraries` to: 
47
44
48
45
```cmake
@@ -73,8 +70,7 @@ endif()
73
70
74
71
add_executable(myapp main.cpp)
75
72
target_link_libraries(myapp objectbox)
76
-
```
77
-
73
+
```cmake
78
74
If you want to integrate the ObjectBox-Generator via CMake (as an alternative to offline installation and pre-generation of C++ sources), use the following snippet:
79
75
80
76
```cmake
@@ -88,8 +84,7 @@ add_obx_schema(
88
84
INSOURCE # Opt-in: Generate in source directory
89
85
CXX_STANDARD 11 # Defaults to C++14 otherwise
90
86
)
91
-
```
92
-
87
+
```cmake
93
88
\
94
89
If you want to use an ObjectBox Sync variant of the library, change the list line to: 
95
90
@@ -204,7 +199,7 @@ Try running `objectbox-generator -help` to verify the installation and see the o
204
199
</TabItem>
205
200
</Tabs>
206
201
207
-
For more details, please refer to the [Generator documentation page](generator.md).
202
+
For more details, please refer to the [Generator documentation page](generator).
208
203
209
204
## FlatBuffers
210
205
@@ -241,13 +236,13 @@ For special setups, the objectbox.hpp header also allows a configuration, which
241
236
:::
242
237
243
238
</TabItem>
244
-
<TabItemvalue="cmake1"label="C without CMake">
239
+
<TabItemvalue="c"label="C without CMake">
245
240
246
241
Get [flatcc library and headers](https://github.com/dvidelabs/flatcc). You can link your program to the to the static runtime library.
247
242
248
243
CMake example (check the link above for the latest version):
`obx_query_find()` needs to be executed inside an explicit read transaction to avoid data copy while preserving its validity (so that concurrent threads won't change the data while you read it). We're omitting this in the examples to keep them simple, see [Transactions](transactions.md#read-transactions) for more details.
81
+
`obx_query_find()` needs to be executed inside an explicit read transaction to avoid data copy while preserving its validity (so that concurrent threads won't change the data while you read it). We're omitting this in the examples to keep them simple, see [Transactions](transactions#read-transactions) for more details.
Copy file name to clipboardExpand all lines: website/docs/schema-changes.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The ObjectBox C / C++ database comes with automatic schema migration. Learn all
16
16
17
17
ObjectBox manages its data model (schema) mostly automatically. The data model is defined by the Entities you define in FlatBuffer schema files. When you **add or remove** entities or properties of your entities, **ObjectBox takes care** of those changes when you launch `objectbox-generator` on the changed `.fbs` file without any further action needed from you.
18
18
19
-
For other changes like **renaming or changing the type**, ObjectBox needs **extra information** to make things unambiguous. This works using unique identifiers (UIDs) specified by the [uid annotation](entity-annotations.md#supported-annotations), as we will see below.
19
+
For other changes like **renaming or changing the type**, ObjectBox needs **extra information** to make things unambiguous. This works using unique identifiers (UIDs) specified by the [uid annotation](entity-annotations#supported-annotations), as we will see below.
20
20
21
21
## Renaming Entities and Properties <ahref="#renaming-entities-and-properties"id="renaming-entities-and-properties"></a>
22
22
@@ -57,7 +57,7 @@ uid annotation value must not be empty:
57
57
```
58
58
59
59
:::info
60
-
Note how for a property, the output is slightly different. It's because you have two options, either renaming the property or resetting (clearing) it's stored data. See [Reset data - new UID on a property](schema-changes.md#reset-data-new-uid-on-a-property) for more details.
60
+
Note how for a property, the output is slightly different. It's because you have two options, either renaming the property or resetting (clearing) it's stored data. See [Reset data - new UID on a property](schema-changes#reset-data-new-uid-on-a-property) for more details.
61
61
:::
62
62
63
63
 **Step 3:** Apply the UID printed in the error message to your entity/property:
Copy file name to clipboardExpand all lines: website/docs/store.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -277,7 +277,7 @@ obx::Store store(options);
277
277
</TabItem>
278
278
<TabItemvalue="c"label="C">
279
279
280
-
```
280
+
```c
281
281
OBX_store_options* opt = obx_opt();
282
282
obx_opt_async_max_in_tx_duration(opt, 1000);
283
283
obx_store_open(opt);
@@ -304,7 +304,7 @@ Available options for fine-tuning asynchronous operations:
304
304
305
305
### Debug Flags
306
306
307
-
When debugging or fine-tuning performance you can enable [logging](dev-tools-and-debugging.md#logging) of various events at the info level.
307
+
When debugging or fine-tuning performance you can enable [logging](dev-tools-and-debugging#logging) of various events at the info level.
308
308
309
309
<Tabs>
310
310
<TabItem value="cpp" label="C++">
@@ -335,8 +335,8 @@ obx_store_open(opt);
335
335
336
336
Once you created the store, it gives you access to several ways to interact with the data you store in it; aka the database:
337
337
338
-
*[**Box API**](getting-started.md#working-with-object-boxes)**:** easy to use object-based API with implicit transactions. It is used in combination with the ObjectBox Generator, which generates the source code for data and Box classes. Check the getting started track for examples.
339
-
*[**Query API**](queries.md)**:** In combination with the Box API, you can build powerful queries using the query builder. Once built, query instances can be executed multiple times to retrieve data. 
340
-
*[**Explicit Transactions**](transactions.md)**:** Often it's a good idea to group several operations into a single "batch", or more precisely, one transaction. Batched transactions are not only faster, but also consider safe state changes for your data.
338
+
* [**Box API**](getting-started#working-with-object-boxes)**:** easy to use object-based API with implicit transactions. It is used in combination with the ObjectBox Generator, which generates the source code for data and Box classes. Check the getting started track for examples.
339
+
* [**Query API**](queries)**:** In combination with the Box API, you can build powerful queries using the query builder. Once built, query instances can be executed multiple times to retrieve data. 
340
+
* [**Explicit Transactions**](transactions)**:** Often it's a good idea to group several operations into a single "batch", or more precisely, one transaction. Batched transactions are not only faster, but also consider safe state changes for your data.
0 commit comments