Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeForMysqlToGo = map[string]string{
"int": "int32",
"integer": "int32",
"tinyint": "int32",
"smallint": "int32",
"mediumint": "int32",
"bigint": "int64",
"int unsigned": "uint32",
"integer unsigned": "uint32",
"tinyint unsigned": "uint32",
"smallint unsigned": "uint32",
"mediumint unsigned": "uint32",
"bigint unsigned": "uint64",
"bit": "int64",
"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": "database.Time",
"datetime": "database.Time",
"timestamp": "database.Time",
"time": "database.Time",
"float": "float64",
"double": "float64",
"decimal": "float64",
"binary": "string",
"varbinary": "string",
"json": "database.JSON",
}
Functions ¶
Types ¶
type Relationship ¶ added in v0.2.7
type Relationship struct { Type string `json:"type"` //关联类型:belongs_to、has_one、has_many、many2many Table string `json:"table"` //关联表名 Alias string `json:"alias"` //别名(可不声明,默认用表名) ForeignKey string `json:"foreign_key"` //外键(可不声明,默认为'id'或'表名_id') ReferenceKey string `json:"reference_key"` //引用键(可不声明,默认为'id'或'表名_id') RelationshipTable string `json:"relationship_table"` //当many2many时,连接表名 JoinForeignKey string `json:"join_foreign_key"` //当many2many时,本表在连接表的外键 JoinTargetKey string `json:"join_target_key"` //当many2many时,关联表在连接表的外键 }
type TableInfo ¶ added in v0.4.0
type TableInfo struct { Columns map[string][]tableColumn Infos map[string]TableInfos }
type TableInfos ¶ added in v0.4.0
type TableInfos map[string]interface{}
func (TableInfos) IsSub ¶ added in v0.4.0
func (t TableInfos) IsSub() bool
Click to show internal directories.
Click to hide internal directories.