# README
What is codegen?
It is a database first code generator for an ORM Layer.
How does it work?
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.
Usage for project know-api
platform and tenant settings have been merged into one config file. tool has been refactored to use relative paths.
Install codegen
cd cmd/codegen
go install
Update from Database
# goto know-api folder
codegen update
Generate code
# goto know-api folder
codegen gen
Special Use-Cases
Removing a Table from a DB
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.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
ExecCommand wraps exec.Command.
Generate main call to start generation.
Parse the config and add all filtered templates that should be processed to each schema and table.
No description provided by the author
No description provided by the author
Initials extracts the initial letters from each word in the string.
No description provided by the author
NewGenBuffer factory.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Constants
PlatformAudit actions*/.
PlatformAudit actions*/.
PlatformAudit actions*/.
PlatformAudit actions*/.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table information_schema.Columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table fake_benchmark.Extensive.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table information_schema.KeyColumnUsage.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table fake_benchmark.Person.
Constants for table columns.
Columns for table fake_benchmark.Pet.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table information_schema.Statistics.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table information_schema.Tables.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Constants for table columns.
Columns for table fake_benchmark.Tag.
Constants for table columns.
# Variables
No description provided by the author
# Structs
Columns represents a row from COLUMNS.
ColumnsPartial is used for updating specific columns from COLUMNS.
No description provided by the author
Extensive represents a row from extensive.
ExtensivePartial is used for updating specific columns from extensive.
GenBuffer type alias for shorter template functions.
KeyColumnUsage represents a row from KEY_COLUMN_USAGE.
KeyColumnUsagePartial is used for updating specific columns from KEY_COLUMN_USAGE.
Person represents a row from person.
PersonPartial is used for updating specific columns from person.
Pet represents a row from pet.
PetPartial is used for updating specific columns from pet.
Statistics represents a row from STATISTICS.
StatisticsPartial is used for updating specific columns from STATISTICS.
Tables represents a row from TABLES.
TablesPartial is used for updating specific columns from TABLES.
Tag represents a row from tag.
TagPartial is used for updating specific columns from tag.
# Interfaces
No description provided by the author
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
GENERATED BY CODEGEN.
No description provided by the author
# Type aliases
Action defines audit action*/.