sqlnamer

package
v1.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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

func (namer SQLNamer) CheckerName(table, column string) string

CheckerName generate checker name

func (SQLNamer) ColumnName

func (namer SQLNamer) ColumnName(_, column string) string

ColumnName overrides the DefaultNamingStrategy.ColumnName as it converts the column names to snake-case, but we need them in lowercase

func (SQLNamer) IndexName

func (namer SQLNamer) IndexName(table, column string) string

IndexName generate index name

func (SQLNamer) JoinTableName

func (namer SQLNamer) JoinTableName(str string) string

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

func (namer SQLNamer) SchemaName(table string) string

SchemaName generate schema name from table name, don't guarantee it is the reverse value of TableName

func (SQLNamer) TableName

func (namer SQLNamer) TableName(str string) string

TableName convert string to table name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL