-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8e9d03
commit deb57c3
Showing
1 changed file
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,33 @@ | ||
# Gencoder | ||
|
||
The ultimate code generator for any languages/frameworks. | ||
A code generator for any languages/frameworks. | ||
|
||
Applicable scenarios for gencoder: | ||
|
||
- You need to modify the generated code and the modified code will not be overwritten | ||
- High customization requirements for generated code | ||
|
||
## Build | ||
## Install | ||
|
||
```bash | ||
make && CGO_ENABLED=0 go build -o gencoder cmd/gencoder/main.go | ||
go install github.com/DanielLiu1123/gencoder/cmd/gencoder | ||
``` | ||
|
||
## Quick Start | ||
|
||
```shell | ||
docker rm -f test_mysql && docker run --name test_mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=testdb -p 3306:3306 -p 33060:33060 -id mysql:latest && sleep 10 && docker exec -i test_mysql mysql -uroot -proot -e "\ | ||
CREATE TABLE testdb.user ( \ | ||
id INT AUTO_INCREMENT PRIMARY KEY, \ | ||
username VARCHAR(64) NOT NULL COMMENT 'Username, required', \ | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'Record creation timestamp' \ | ||
) COMMENT='User account information';" | ||
``` | ||
|
||
If you updated Handlebars.js version or added new helpers in `pkg/jsruntime/helpers.js`: | ||
```bash | ||
go generate ./... | ||
``` | ||
gencoder init | ||
``` | ||
|
||
```bash | ||
gencoder generate | ||
``` |