types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Abbre = map[string]string{
	"id":   "ID",
	"ip":   "IP",
	"uid":  "UID",
	"uuid": "UUID",
}

Abbre 缩写

View Source
var MysqlType2GoType = map[string]string{
	"tinyint":    "int8",
	"smallint":   "int16",
	"mediumint":  "int32",
	"int":        "int32",
	"bigint":     "int64",
	"bit":        "int",
	"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",
	"binary":     "string",
	"varbinary":  "string",
	"json":       "string",
	"float":      "float64",
	"double":     "float64",
	"decimal":    "float64",
	"time":       "time.Time",
	"date":       "time.Time",
	"datetime":   "time.Time",
	"timestamp":  "time.Time",
}

MysqlType2GoType mysql type to go type

View Source
var PostgresType2GoType = map[string]string{
	"int2":     "int16",
	"smallint": "int16",

	"int4":    "int32",
	"integer": "int32",

	"int8":   "int64",
	"bigint": "int64",

	"smallserial": "int16",
	"serial":      "int32",
	"bigserial":   "int64",

	"float4":  "float64",
	"float8":  "float64",
	"decimal": "float64",
	"numeric": "float64",

	"varchar": "string",
	"char":    "string",
	"text":    "string",

	"bool":    "bool",
	"boolean": "bool",

	"json":  "string",
	"jsonb": "string",

	"timestamp": "time.Time",
	"date":      "string",
	"time":      "string",

	"cidr":     "string",
	"inet":     "string",
	"macaddr":  "string",
	"macaddr8": "string",
}

PostgresType2GoType postgres type to go type

Functions

This section is empty.

Types

type Options

type Options struct {
	Dsn     string
	Output  string
	GenPool bool
}

Options .

type Tag

type Tag []string

Tag gorm tag

func (*Tag) Append

func (t *Tag) Append(k string, v interface{})

Append .

func (*Tag) String

func (t *Tag) String() string

String .

type TagType

type TagType []string

TagType gorm tag

func (*TagType) Append

func (tt *TagType) Append(k string, v ...string)

Append .

func (*TagType) String

func (tt *TagType) String() string

String .

Jump to

Keyboard shortcuts

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