Documentation ¶
Index ¶
- type SQLNamer
- func (namer SQLNamer) CheckerName(table, column string) string
- func (namer SQLNamer) ColumnName(_, column string) string
- func (namer SQLNamer) IndexName(table, column string) string
- func (namer SQLNamer) JoinTableName(str string) string
- func (namer SQLNamer) RelationshipFKName(rel schema.Relationship) string
- func (namer SQLNamer) SchemaName(table string) string
- func (namer SQLNamer) TableName(str string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLNamer ¶
type SQLNamer struct { // DefaultNamingStrategy to use the methods of the default NamingStrategy of gorm if modification not needed DefaultNamingStrategy schema.NamingStrategy }
SQLNamer overrides the default naming conventions used by gorm
func (SQLNamer) CheckerName ¶
CheckerName generate checker name
func (SQLNamer) ColumnName ¶
ColumnName overrides the DefaultNamingStrategy.ColumnName as it converts the column names to snake-case, but we need them in lowercase
func (SQLNamer) JoinTableName ¶
JoinTableName convert string to join table name
func (SQLNamer) RelationshipFKName ¶
func (namer SQLNamer) RelationshipFKName(rel schema.Relationship) string
RelationshipFKName generate fk name for relation
func (SQLNamer) SchemaName ¶
SchemaName generate schema name from table name, don't guarantee it is the reverse value of TableName
Click to show internal directories.
Click to hide internal directories.