struct. It could be located basically anywhere but to keep our project structure clean, let's have it in a
Builderand give it model information and optionally some other settings. The code with the model information is generated by the ObjectBox and you just need to use in your code:
Putto insert or update objects. When put succeeds, an ID will be assigned to the entity.
Get. It will return
nil& error in case an error occurred and
nilwithout any error if the object doesn't exist. To get all objects of a type, use
GetAllwhich returns a slice.
RemoveAllto delete all objects and empty the box.