gormidxname

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamingStrategies

func GetNamingStrategies() map[IndexNamePattern]Naming

Types

type GenerateIndexNameResult

type GenerateIndexNameResult struct {
	IndexTagFieldName string
	NewIndexName      string
	IdxUdxPrefix      string
}

type IndexNamePattern

type IndexNamePattern string

nolint:no-doc 自定义枚举类型

const (
	WithTableCnm IndexNamePattern = "cnm" //表示使用 column name 作为拼接索引名的规则
	UppercaseCnm IndexNamePattern = "CNM" //表示使用 column name 作为拼接索引名的规则,但后缀是大写字母的

	DefaultPattern IndexNamePattern = WithTableCnm
)

type Naming

type Naming interface {
	IsValidIndexName(indexName string) bool
	GenerateIndexName(schemaIndex schema.Index, tableName string, fieldName string, columnName string) *GenerateIndexNameResult
}

Jump to

Keyboard shortcuts

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