Lunny Xiao
4 years ago
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
2 changed files with
12 additions and
0 deletions
-
README.md
-
README_CN.md
|
|
@ -54,6 +54,7 @@ targets: |
|
|
|
column_mapper: snake # how column name map to class or struct field name |
|
|
|
table_prefix: "" # table prefix |
|
|
|
multiple_files: true # generate multiple files or one |
|
|
|
language: golang |
|
|
|
template: | # template for code file, it has higher perior than template_path |
|
|
|
package models |
|
|
|
|
|
|
@ -86,6 +87,11 @@ targets: |
|
|
|
- *TableMapper*: Mapper method to convert table name to class/struct name. |
|
|
|
- *ColumnMapper*: Mapper method to convert column name to class/struct field name. |
|
|
|
|
|
|
|
## Golang Template Funcs |
|
|
|
|
|
|
|
- *Type*: return column's golang type |
|
|
|
- *Tag*: return golang struct tag for column |
|
|
|
|
|
|
|
## Template Vars |
|
|
|
|
|
|
|
- *Tables*: All tables. |
|
|
@ -54,6 +54,7 @@ targets: |
|
|
|
column_mapper: snake # 字段名到代码或结构体成员的映射关系 |
|
|
|
table_prefix: "" # 表前缀 |
|
|
|
multiple_files: true # 是否生成多个文件 |
|
|
|
language: golang |
|
|
|
template: | # 生成模板,如果这里定义了,优先级比 template_path 高 |
|
|
|
package models |
|
|
|
|
|
|
@ -82,6 +83,11 @@ targets: |
|
|
|
- *TableMapper*: 将表名转为结构体名的映射函数。 |
|
|
|
- *ColumnMapper*: 将字段名转为结构体成员名的函数。 |
|
|
|
|
|
|
|
## Go 语言模版函数 |
|
|
|
|
|
|
|
- *Type*: 返回Go语言的类型 |
|
|
|
- *Tag*: 返回Go语言的Tag信息 |
|
|
|
|
|
|
|
## 模板变量 |
|
|
|
|
|
|
|
- *Tables*: 所有表。 |