defines

package
v0.0.0-...-9fc367e Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBTypeToStructType = map[string]string{
	"int":                "int",
	"integer":            "int",
	"tinyint":            "int8",
	"smallint":           "int16",
	"mediumint":          "int32",
	"bigint":             "int64",
	"int unsigned":       "uint",
	"integer unsigned":   "uint",
	"tinyint unsigned":   "uint8",
	"smallint unsigned":  "uint16",
	"mediumint unsigned": "uint32",
	"bigint unsigned":    "uint64",
	"bit":                "byte",
	"bool":               "bool",
	"enum":               "string",
	"set":                "string",
	"varchar":            "string",
	"char":               "string",
	"tinytext":           "string",
	"mediumtext":         "string",
	"text":               "string",
	"longtext":           "string",
	"blob":               "string",
	"tinyblob":           "string",
	"mediumblob":         "string",
	"longblob":           "string",
	"date":               "time.Time",
	"datetime":           "time.Time",
	"timestamp":          "time.Time",
	"time":               "time.Time",
	"float":              "float64",
	"double":             "float64",
	"decimal":            "float64",
	"binary":             "string",
	"varbinary":          "string",
}

DBTypeToStructType 数据库数据类型到 go 结构体数据类型的转换规则

View Source
var StructTemplateText = map[string]string{
	"title": "type STRUCT_NAME struct {",
	"line":  "	FIELD_NAME	FIELD_TYPE	FIELD_TAG",
	"end":   "}",
}

Functions

This section is empty.

Types

type Config

type Config struct {
	DB DBConfig
}

type DBConfig

type DBConfig struct {
	IP       string `toml:"ip"`
	Port     string `toml:"port"`
	Username string `toml:"username"`
	Password string `toml:"password"`
	Charset  string `toml:"charset"`
}

type StructColumn

type StructColumn struct {
	Name    string
	Type    string
	Tag     string
	Comment string
}

StructColumn go 结构体字段信息

type TableColumn

type TableColumn struct {
	ColumnName    string
	DataType      string
	ColumnKey     string
	IsNullable    string
	ColumnType    string
	ColumnComment string
}

TableColumn 数据库中字段信息

Jump to

Keyboard shortcuts

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