-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.sqlgen.yaml
69 lines (68 loc) · 2.25 KB
/
.sqlgen.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
version: "0.1"
database:
# 数据库连接 consult[https://gorm.io/docs/connecting_to_the_database.html]"
dsn: "dbUser:dbPassword@tcp(host:port)/dbName?charset=utf8mb4&parseTime=true&loc=Asia%2FShanghai"
# 数据库类型 consult[https://gorm.io/docs/connecting_to_the_database.html]
db: "mysql"
# 表类型 You can cli input : orders,users,goods
tables:
- ms_system_inform
defaultAllTable: false
# generate with pointer when field is nullable
fieldNullable: false
fieldCoverable: false
fieldSignable: true
# 是否覆盖文件
overwrite: false
# table 正则用于替换路径使用
tableRegexp: ^([a-z]+)_([a-z_]+)$
modelName: "{2}"
# table 正则风格
tableRegexpStyle: lower # lower/camel/snake
# 自定义tag 按json 蛇形添加
fieldWithTags:
- json
# 指定模板目录,默认系统模板
templateDir:
templates:
- outPath: "./internal/domain/{1}/internal/model/{2}/model.go"
name: "Model"
- outPath: "./internal/domain/{1}/bean/{2}/interface.go"
name: "BeanInterface"
- outPath: "./internal/domain/{1}/bean/{2}/bean.go"
name: "Bean"
- outPath: "./internal/domain/{1}/bean/{2}/po.go"
name: "PO"
- outPath: "./internal/types/{2}/types.go"
name: "Types"
- outPath: "./internal/domain/{1}/internal/mapper/{2}/interface.go"
name: "MapperInterface"
- outPath: "./internal/domain/{1}/internal/mapper/{2}/mapper.go"
name: "Mapper"
- outPath: "./internal/domain/{1}/service/{2}/interface.go"
name: "ServiceInterface"
- outPath: "./internal/domain/{1}/service/{2}/service.go"
name: "Service"
- outPath: "./internal/handle/adminapi/v1/{2}/interface.go"
name: "AdminHandlerInterface"
isGo: true
- outPath: "./internal/handle/adminapi/v1/{2}/handler.go"
name: "AdminHandler"
isGo: true
dynamicConstSuffixes:
- "Status"
- "Type"
autoValueFields:
- "ID"
- "UpdateTime"
- "CreateTime"
dynamicConstOutPath: "./internal/consts/{2}/consts.go"
dynamicConstTemplate: "Consts"
dynamicConstImport: false
initialisms: true # 缩略词
dynamicAliasSuffix: "Consts"
convTypeMap:
timestamp: "timex.Time"
datetime: "timex.Time"
convTypePkgMap:
"timex.Time": "gofastddd/internal/utils/timex"