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)
}
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 isprofit_and_los.go