gogen | go packages and command line tools | Development Tools library
kandi X-RAY | gogen Summary
kandi X-RAY | gogen Summary
A set of go packages and command line tools to generate Go code
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- analyzeCode analyzes code .
- replace replaces the AST nodes of a node .
- Main entry point for export .
- Process parses a package from pkg .
- parsePackageSource parses package source code .
- processFile parses the given file and returns a processedFile .
- Clean writes a source to w .
- NewGenerator returns a new Generator .
- New returns a new Generator .
- write writes a list of processedFiles to outdir .
gogen Key Features
gogen Examples and Code Snippets
Community Discussions
Trending Discussions on gogen
QUESTION
Unfortunately, ObjectBox Go's docs provide no information about deletion of entire type structure "powered" by ObjectBox.
Let's say we have a struct
...ANSWER
Answered 2020-Sep-08 at 08:37Currently, the ObjectBox code generator doesn't delete entities because it works with partial input information (a single file at a time) and therefore it doesn't know whether you have removed an entity or it will be in the next file the generator is called for.
I've created a follow-up issue/feature request on GH: https://github.com/objectbox/objectbox-generator/issues/22
If you really needed to remove the entity NOW, until the removal feature is added to the generator: the current workaround, would be to manually update the objectbox-model.json
, removing the entity JSON code block defining it and adding its uid
to the retiredEntityUids
list to avoid reuse of the same UID (which would break things). Additionally, the same has to be done for the removed properties, indexes, and relations (each has its retired*Uids
list). After the generator is re-run, the entity would be removed from the objectbox-model.go
.
I don't recommend doing this as it's easy to make an error when manually editing the model JSON file, potentially causing a loss of data. If you can, wait for the generator to support the removal.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gogen
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page