名称映射规则主要负责结构体名称到表名和结构体field到表字段的名称映射。由core.IMapper接口的实现者来管理,xorm内置了三种IMapper实现:core.SnakeMapper , core.SameMapper和core.GonicMapper。
core.SnakeMapper
core.SameMapper
core.GonicMapper
当前SnakeMapper为默认值,如果需要改变时,在engine创建完成后使用
engine.SetMapper(core.SameMapper{})
同时需要注意的是:
engine.SetTableMapper(core.SameMapper{}) engine.SetColumnMapper(core.SnakeMapper{})
When a struct auto mapping to a database's table, the below table describes how they change to each other:
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8