forked from go-gorm/gen
-
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.
gentool accept config file go-gorm#252 (go-gorm#275)
* feat(gentool):"gentool accept config file go-gorm#252" * fix(gen.yml):add new line * fix(go.mod,gentool):"update yaml to v3 and cmd first" * update("README"):"The command line is the highest priority"
- Loading branch information
Showing
6 changed files
with
139 additions
and
13 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
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
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 |
---|---|---|
|
@@ -40,6 +40,12 @@ | |
``` | ||
#### c | ||
default "" | ||
可以指定配置文件gen.yml的路径。 | ||
用配置文件来代替命令行。 | ||
命令行是最高优先级。 | ||
#### db | ||
默认值:mysql | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: "0.1" | ||
database: | ||
# consult[https://gorm.io/docs/connecting_to_the_database.html]" | ||
dsn : "user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local" | ||
# input mysql or postgres or sqlite or sqlserver. consult[https://gorm.io/docs/connecting_to_the_database.html] | ||
db : "mysql" | ||
# enter the required data table or leave it blank.You can input : orders,users,goods | ||
tables : "" | ||
# specify a directory for output | ||
outPath : "./dao/query" | ||
# query code file name, default: gen.go | ||
outFile : "" | ||
# generate unit test for query code | ||
withUnitTest : false | ||
# generated model code's package name | ||
modelPkgName : "" | ||
# generate with pointer when field is nullable | ||
fieldNullable : false | ||
# generate field with gorm index tag | ||
fieldWithIndexTag : false | ||
# generate field with gorm column type tag | ||
fieldWithTypeTag : false |
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