Skip to content

New feature: Field mapper function

Compare
Choose a tag to compare
@huandu huandu released this 21 Feb 12:32
· 80 commits to master since this release

Per #59, new APIs around field mapper functions are added.

In many production environments, table column names are usually snake_case words, e.g. user_id, while we have to use CamelCase in struct types to make struct fields public and golint happy. It's a bit redundant to use the db tag in every struct field. If there is a certain rule to map field names to table column names, We can use field mapper function to make code simpler.

See field mapper function sample as a demo.