dbms

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Columns

type Columns struct {
	TableSchema     string `gorm:"column:TABLE_SCHEMA;"`     //数据库名
	TableName       string `gorm:"column:TABLE_NAME;"`       //表名
	ColumnName      string `gorm:"column:COLUMN_NAME;"`      //列名
	ColumnKey       string `gorm:"column:COLUMN_KEY;"`       //主键,PRI=主键
	OrdinalPosition string `gorm:"column:ORDINAL_POSITION;"` //列顺序,升序
	ColumnDefault   string `gorm:"column:COLUMN_DEFAULT;"`   //列默认值
	IsNullable      string `gorm:"column:IS_NULLABLE;"`      //是否允许为弄 NO/YES
	DataType        string `gorm:"column:DATA_TYPE;"`        //列数据类型
	ColumnType      string `gorm:"column:COLUMN_TYPE;"`      //列数据类型,含长度
	Extra           string `gorm:"column:EXTRA;"`            //是否自增 auto_increment=自增
	ColumnComment   string `gorm:"column:COLUMN_COMMENT;"`   //列注释
	GoName          string //struct的属性名,用大驼峰格式
	JsonName        string //属性的json格式化名,用小驼峰格式
	GoType          string //数据库类型对应的GO语言类型
}

Columns 列信息

type DbInfo

type DbInfo struct {
	DbTables []Tables //表信息 + 列信息

}

DbInfo 数据库信息,含表明和列名

type Tables

type Tables struct {
	TableSchema  string            `gorm:"column:TABLE_SCHEMA;type:varchar(64);"`   //数据库名
	TableName    string            `gorm:"column:TABLE_NAME;type:varchar(64);"`     //表名
	TableComment string            `gorm:"column:TABLE_COMMENT;type:varchar(256);"` //表描述
	PackageName  string            `gorm:"-"`                                       //生成模板文件的包名
	GoName       string            `gorm:"-"`                                       //要生成的struct名
	TableColumns []Columns         `gorm:"-"`                                       //表下面的所有列名
	Imports      map[string]string `gorm:"-"`                                       //要导入的包
}

Tables 要用户信息表

Jump to

Keyboard shortcuts

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