Comments (2)
What's the current behavior? I think when reading a non-present field from FB e.g. into an int
the resulting value should be the the default (zero).
Hmm, nullable... Would like to avoid that (first annotation specific to generator(?)), but I guess we don't have much choice? 🤔 To make things worse, there might be multiple options, e.g. raw pointer, std::unique_ptr
and std::optional
.
PS.: std::optional
represents the FB behavior best. And, if we decide to add an annotation, I see "optional" are a more fitting name.
PSS.: In Java, there are some locations, where you have to provide a "null value". E.g. imagine an annotation on the fbs like "null-value: -1"; reading from FB without a value would result in an int value -1 (and vice versa). I'm not saying that this is the best idea ever, just to throw in some brainstorming here....
from objectbox-generator.
We could also make use of .fbs
field "default" value being explicitly specified to mean the field is nullable and should be stored as null if its value equals to the default... Then the generated store/load code would behave pretty much like standard flatbuffers.
from objectbox-generator.
Related Issues (20)
- Generated code compatibility check
- Use obx_id for ID HOT 3
- Minimize changes in "expected files" HOT 1
- Deleting an entity from an existing model HOT 1
- Deduplicate annotation parsing
- Improve CI coverage
- Reconsider `auto` types in C++ fromFlatBuffer()
- Support enums in .fbs HOT 1
- Does not support nested tables or structs
- Optimization: special null values HOT 4
- cd into a file's dir to make includes work
- Option to specify json model file HOT 2
- Does it support different languages in the database?
- C++ 14+ output option to use make-unique
- objectbox-go generator can not handle a struct with multiple lazy loaded relations
- Cannot build objectbox-generator
- C++ One to many relationship HOT 2
- C flatcc builder (put) optimization HOT 6
- C generated get/put HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objectbox-generator.