helper

package
v0.0.0-...-6d7266f Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupByColumn

func GroupByColumn(indexList []gorm.Index) map[string][]string

group columns

Types

type Field

type Field struct {
	// NameOriginal    string
	Name string
	// ThirdPkg        string
	DataType        string
	Comment         string
	SeqInIndex      int
	OrdinalPosition int
}

Field describes a table field

func ConvertColumnToField

func ConvertColumnToField(col gorm.ColumnType) Field

func ConvertFieldToField

func ConvertFieldToField(col *parser.Field) Field

type KeyType

type KeyType int

KeyType types alias of int

type Primary

type Primary struct {
	Field
	AutoIncrement bool
}

Primary describes a primary key

type Table

type Table struct {
	Name        string
	Db          string
	PrimaryKey  Primary
	UniqueIndex map[string][]*Field
	Fields      []*Field
}

Table describes a mysql table

func ParseTableFromDsn

func ParseTableFromDsn(dsn string) (list []*Table, err error)

从数据库中解析Table

func ParseTableFromSql

func ParseTableFromSql(sql string) (list []*Table, err error)

从sql文件解析Table

Jump to

Keyboard shortcuts

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