We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I implement custom Namer interface for NamingStrategy
Namer
type Namer interface { TableName(table string) string SchemaName(table string) string ColumnName(table, column string) string JoinTableName(table string) string RelationshipFKName(Relationship) string CheckerName(table, column string) string IndexName(table, column string) string }
table parmater is a type name without the package prefix (e.g. User instead of users.User), so how should I distinguish one table from another?
table
User
users.User
Also when trying to override table name manually during the query:
db.Table("test").First(&User{})
The table param is User and not the test. Is it an expected behaviour?
test
The text was updated successfully, but these errors were encountered:
No, it should be test
We don't care which package is it from, if package distinction is important in your case, perhaps you want to refer to https://gorm.io/docs/conventions.html#TableName
Sorry, something went wrong.
Should I open a bug report then?
jinzhu
No branches or pull requests
Your Question
When I implement custom
Namer
interface for NamingStrategytable
parmater is a type name without the package prefix (e.g.User
instead ofusers.User
), so how should I distinguish one table from another?Also when trying to override table name manually during the query:
The
table
param isUser
and not thetest
. Is it an expected behaviour?The document you expected this should be explained
Expected answer
The text was updated successfully, but these errors were encountered: