It is a database first code generator for an ORM Layer.
It uses 2 steps.
- Inspect MySQL and create or update a JSON configuration file, that represents the database.
- This file may be changed to use some advanced features, which are not fully automagically possible with MySQL inspection.
- Read the config file and generate the code.
platform and tenant settings have been merged into one config file. tool has been refactored to use relative paths.
cd cmd/codegen
go install
# goto know-api folder
codegen update
# goto know-api folder
codegen gen
codegen does not remove anything from the settings file automatically, because manual change is allowed. Therefore a removal of a table can not be handled by codegen alone.
- Remove the table from the DB
- Remove the corresponding settings from your codegen.json
- Remove any previously generated files for that table.