gormmomname

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[ColumnNamePattern]Naming

Types

type ColumnNamePattern

type ColumnNamePattern string

nolint:no-doc 自定义枚举类型,表示使用何种字段验证方式来验证,由于不同的DB的列名规则是不同的,因此通常建议是取各种DB的交集

const (
	Lowercase30 ColumnNamePattern = "s30"
	Uppercase30 ColumnNamePattern = "S30"
	Lowercase63 ColumnNamePattern = "s63"
	Uppercase63 ColumnNamePattern = "S63"

	DefaultPattern ColumnNamePattern = Lowercase63
)

type Naming

type Naming interface {
	IsValidColumnName(columnName string) bool
	GenerateColumnName(fieldName string) string
}

Jump to

Keyboard shortcuts

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