不支持特定名称的字段 #27
Labels
No Label
bug
duplicate
enhancement
feature
help wanted
invalid
question
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/reverse#27
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
You can use
xorm:"'column_name'"
to customerize the column name是template问题啊,老哥。
xorm.io\reverse@v0.1.1\language\golang.go:236
这个 template 就没给
xorm:""
这个tag 留什么定制修改的余地。至少给个
xorm:"{{Tags $table $col}}"
才有调整的空间吧。尝试做了一个 workaround
还有个差不多是同类的问题。
yaml 提供了
column_mapper
和table_mapper
两个选项让用户自己定义怎么把名字映射进 go ,但修改这两个配置需要在代码里改engine.SetColumnMapper
和enigne.SetTableMapper
,不然就要改 template,很麻烦还容易人为出错。直接在默认 template 里,显式映射每个字段到 column,显式映射每个 struct 到 table,这样不是更好吗?
@lunny
Good idea!