diff --git a/README.md b/README.md index 7cff9c7..4e067ea 100644 --- a/README.md +++ b/README.md @@ -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 ./... -``` \ No newline at end of file +gencoder init +``` + +```bash +gencoder generate +```