model

package
v0.1.1-beta Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoType

func GetGoType(k, t string) (v string)

Types

type ColumnMetaData

type ColumnMetaData struct {
	// 列名
	Name string
	// 列类型
	DBType string
	// 对应 go语言的什么类型
	GoType string
	// 无符号???
	IsUnsigned bool
	// 是否空
	IsNullable bool
	// 表名称
	TableName string
	// 备注
	Remark string
	// 是否为主键
	IsPKey bool
}

ColumnMetaData 列元数据

func NewColumnMetaData

func NewColumnMetaData(name string, isNullable bool, dataType string, isUnsigned bool, tableName, remark string, isKey bool, databaseType string) (columnMeta *ColumnMetaData)

NewColumnMetaData 创建列数据源对象

func (*ColumnMetaData) InitGoType

func (c *ColumnMetaData) InitGoType(databaseType string)

type ColumnMetaDataList

type ColumnMetaDataList []*ColumnMetaData

ColumnMetaDataList 列元数据集

type FlagModel

type FlagModel struct {
	// 数据库类型
	DatabaseType string `json:"database_type"`
	// 输出的目录
	OutDir string `json:"out_dir"`
	// 连接字符串
	Url         string   `json:"url"`
	Table       []string `json:"table"`
	TableStr    string   `json:"table_str"`
	PackageName string   `json:"package_name"`
}

func (*FlagModel) InitTables

func (f *FlagModel) InitTables()

InitTables 初始化表

type TableMataDataList

type TableMataDataList []*TableMetaData

TableMataDataList 表元数据集

type TableMetaData

type TableMetaData struct {
	// 表名
	Name string
	// 列元数据
	Columns ColumnMetaDataList
}

TableMetaData 表元数据

Jump to

Keyboard shortcuts

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