model

package
v0.0.0-...-e365ac7 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name      string // 字段名
	CamelName string // 驼峰字段名
	Type      string // MySQL中原始数据类型
	ColumnKey string // PRI说明是主键
	Comment   string // Mysql中原始注释

	GoType    string  // Go结构体字段类型
	GoJsonTag string  // GO结构体中json标签
	GoComment Comment // 从注释中json反序列化的Comment
}

type ColumnSchema

type ColumnSchema struct {
	ColumnName             string
	IsNullable             string
	DataType               string
	CharacterMaximumLength sql.NullInt64
	NumericPrecision       sql.NullInt64
	NumericScale           sql.NullInt64
	ColumnType             string
	ColumnKey              string // PRI,UNI,MUL
	Comment                string
}

type Comment

type Comment struct {
	Data string `json:"data"` // 注释内容
	Type string `json:"type"` // slice代表数组
}

type Table

type Table struct {
	Imports         map[string]struct{} // imports表
	HasPrimaryKey   bool                // 是否是主键
	CamelPrimaryKey string              // 转成驼峰的主键字段名
	PrimaryKey      string              // 主键字段名
	PrimaryKeyType  string              // 主键字段类型
	Columns         []Column            // 所有字段
}

type TableSchema

type TableSchema struct {
	TableName              string
	ColumnName             string
	IsNullable             string
	DataType               string
	CharacterMaximumLength sql.NullInt64
	NumericPrecision       sql.NullInt64
	NumericScale           sql.NullInt64
	ColumnType             string
	ColumnKey              string
	Comment                string
}

Jump to

Keyboard shortcuts

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