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

fix:table name may not be the same as in the database #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiiiew
Copy link

@xiiiew xiiiew commented Sep 22, 2022

When I use entimport to generate ent code, if the table name in the database ends with s, it will be trimmed. In order to make the generated code consistent with the database, it is recommended not to call this method.

for example, my table name is profit_and_loss, and the generated file name is profit_and_los.go

// old version
func typeName(tableName string) string {
	return inflect.Camelize(inflect.Singularize(tableName))
}

// new version
func typeName(tableName string) string {
	return inflect.Camelize(tableName)
}

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

Successfully merging this pull request may close these issues.

1 participant