Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/objectbox/objectbox-generator
ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
https://github.com/objectbox/objectbox-generator
c code-generator cpp cross-platform database embedded go golang nosql objectbox
Last synced: 14 days ago
JSON representation
ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
- Host: GitHub
- URL: https://github.com/objectbox/objectbox-generator
- Owner: objectbox
- License: agpl-3.0
- Created: 2020-06-12T08:14:45.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-04T14:16:29.000Z (3 months ago)
- Last Synced: 2025-01-03T06:46:19.526Z (21 days ago)
- Topics: c, code-generator, cpp, cross-platform, database, embedded, go, golang, nosql, objectbox
- Language: Go
- Homepage: https://objectbox.io
- Size: 3.25 MB
- Stars: 38
- Watchers: 4
- Forks: 11
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[![Follow ObjectBox on Twitter](https://img.shields.io/twitter/follow/ObjectBox_io.svg?style=flat-square&logo=twitter&color=fff)](https://twitter.com/ObjectBox_io)
# ObjectBox Generator
Current version: 4.0.0-beta
ObjectBox is a superfast cross-platform object-oriented database.
ObjectBox Generator produces code for ObjectBox C, C++ and Go APIs (more languages to be supported in the future).
This greatly simplifies using ObjectBox in your favourite language.## Download
Install the objectbox-generator by downloading the latest binary for your OS from [releases](https://github.com/objectbox/objectbox-generator/releases/latest).
If you want, add it to `$PATH` for convenience.Alternatively, CMake users can fetch ObjectBox and the Generator for C++ using FetchContent
([link](https://cpp.objectbox.io/installation)).## Build
If you prefer to build the generator yourself (vs. downloading), clone this repo and simply run `make`.
This will produce an "objectbox-generator" binary in the main project directory.Build notes:
* To build yourself, you need Go, Make, CMake and a C++11 tool chain.
* To run test suite, run `make test-depend test`.
* `test-depend` needs to run only once to download objectbox core library and to build flatcc.
* A full test cycle can be triggered by `make clean all test-depend test`.## Getting started
To get started, have a look at the specific language bindings (the approaches differ):
* C and C++ [repository](https://github.com/objectbox/objectbox-c) and [docs](https://cpp.objectbox.io/).
In summary, you define a FlatBuffers schema file, and the ObjectBox Generator will create plain C++ data classes
and helper classes that "glue" the data classes to the ObjectBox runtime library.
CMake users can also use the convenient add_obx_schema() task instead of using the generator executable directly.
* Go [repository](https://github.com/objectbox/objectbox-go) and [docs](https://golang.objectbox.io/).
Here, you start with Go data structs, for which the Generator generates the glue code directly.## Development Notes
* Clean test cache: `go clean -testcache`
* Run test suite `test/comparison` with flag `-update` to update expected files.
* Run test suite `test/integration` with flag `-insource` to generate code in source may be helpful (e.g. `cd test/integration && go test ./... -insource`)# License
```
ObjectBox Generator - a build time tool for ObjectBox
Copyright (C) 2018-2024 ObjectBox Ltd. All rights reserved.
https://objectbox.io
This file is part of ObjectBox Generator.ObjectBox Generator is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ObjectBox Generator is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with ObjectBox Generator. If not, see .
```Note: AGPL only applies to the Generator itself and not to generated code.
You can regard generated code as "your code", and we impose no limitation on distributing it.
And, just to clarify: as the Generator does not include any warranty, there can be no warranty for the code it generates.# Do you ♥️ using ObjectBox?
We want to [hear about your project](https://docs.google.com/forms/d/e/1FAIpQLScIYiOIThcq-AnDVoCvnZOMgxO4S-fBtDSFPQfWldJnhi2c7Q/viewform)!
It will - literally - take just a minute, but help us a lot. Thank you! 🙏