This repository has been archived on 2022-04-14. You can view files and clone it, but cannot push or open issues or pull requests.
manual-en-US/chapter-02/3.tags.md
2020-03-27 14:29:41 +08:00

551 B

2.3.Tag mapping

Using names.Mapper for all naming is the best choice. But if table or column is not in rule, we need new method to archive.

  • If struct or pointer of struct has TableName() string method, the return value will be the struct's table name.

  • engine.Table() can change the database table name for struct. The struct tag xorm:"'column_name'" can set column name for struct field. Use a pair of single quotes to prevent confusion for column's definition in struct tag. If there is no risk of confusion, ignore single quotes.