util

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ColumnTypeStr       = []string{"char", "varchar", "varchar2", "tinytext", "text", "mediumtext", "longtext", "binary", "varbinary", "blob"}
	ColumnTypeDate      = []string{"date"}
	ColumnTypeTime      = []string{"datetime", "time", "timestamp"}
	ColumnTypeNumber    = []string{"tinyint", "smallint", "mediumint", "int", "integer", "bigint", "float", "double", "decimal", "numeric", "bit"}
	ColumnNameNotEdit   = []string{"created_by", "created_at", "updated_by", "updated_at", "deleted_at"}
	ColumnNameNotList   = []string{"updated_by", "updated_at", "deleted_at"}
	ColumnNameNotDetail = []string{"updated_by", "updated_at", "deleted_at"}
	ColumnNameNotQuery  = []string{"updated_by", "updated_at", "deleted_at", "remark"}
)

Functions

func GetColumnLength

func GetColumnLength(columnType string) int

GetColumnLength 获取字段长度

func GetDataType

func GetDataType(sqlType string) (dataType string, isUnsigned bool)

func GetDbType

func GetDbType(columnType string) string

GetDbType 获取数据库类型字段

func GetGoModule

func GetGoModule(file string) (string, error)

func GetGoModuleName

func GetGoModuleName() (string, error)

func IsDateObject

func IsDateObject(dataType string) bool

IsDateObject 判断是否是数据库时间类型

func IsExistInArray

func IsExistInArray(value string, array []string) bool

IsExistInArray 判断 value 是否存在在切片array中

func IsNumberObject

func IsNumberObject(dataType string) bool

IsNumberObject 是否数字类型

func IsStringObject

func IsStringObject(dataType string) bool

IsStringObject 判断是否是数据库字符串类型

func IsTimeObject

func IsTimeObject(dataType string) bool

IsTimeObject 判断是否是数据库时间类型

func LoadTableDefYaml

func LoadTableDefYaml(ctx context.Context, tableName string, yamlInputPath string, goModuleName string, cache map[string]*model.TableDef) (*model.TableDef, error)
func ParseDblink(dblink string) error

func SplitComma

func SplitComma(str string) []string

func TemplateEngine

func TemplateEngine() *gview.View

func TrimBreak

func TrimBreak(str string) (rStr string, err error)

func WriteFile

func WriteFile(fileName, data string, cover bool) (err error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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