Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]table prefix support #78

Closed
leopku opened this issue Jun 10, 2020 · 3 comments
Closed

[Feature Request]table prefix support #78

leopku opened this issue Jun 10, 2020 · 3 comments

Comments

@leopku
Copy link
Contributor

leopku commented Jun 10, 2020

All my tables had same prefix like xxx_, for example:

xxx_users
xxx_posts
xxx_tokens

The generated codes like model, dao, routes all have xxx included, like XxxUser , GetAllXxxUser and /xxxuser, /xxxuser/:argId.

I wanna request a new feature like adding something like a param named prefix and auto stripping the prefix when generating codes. The ideal model, dao, routes look likes following User, GetAllUser, /user and /user/:argId

@alexj212
Copy link
Collaborator

The latest release v0.9.8 has the following changes
- Added ability to set file naming convention for models, dao, apis and grpc --file_naming={{.}}
- Added ability to set struct naming convention --model_naming={{.}}

You should be able to pass

--file_naming='{{replace . "xxx_" ""}}'

@leopku
Copy link
Contributor Author

leopku commented Jun 10, 2020

The latest release v0.9.8 has the following changes

  • Added ability to set file naming convention for models, dao, apis and grpc --file_naming={{.}}
  • Added ability to set struct naming convention --model_naming={{.}}

You should be able to pass

--file_naming='{{replace . "xxx_" ""}}'

awesome.

I'll taste it tomorrow.

Big thanks.

@leopku
Copy link
Contributor Author

leopku commented Jun 11, 2020

Works perfect.
Thanks @alexj212 .

@leopku leopku closed this as completed Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants