Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeMap = map[string]func(gorm.ColumnType) string{ "BOOLEAN": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "bool") }, "BOOL": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "bool") }, "TINYINT": func(ct gorm.ColumnType) string { col, _ := ct.ColumnType() n, _ := ct.Nullable() if strings.HasPrefix(strings.ToUpper(col), "TINYINT(1)") { return nullablePtr(n, "bool") } return nullablePtr(n, "int8") }, "SMALLINT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int16") }, "INTEGER": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int64") }, "INT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int64") }, "INT2": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int16") }, "INT8": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int64") }, "MEDIUMINT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int32") }, "UNSIGNED BIG INT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "uint64") }, "BIGINT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "int64") }, "REAL": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "float64") }, "DOUBLE": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "float64") }, "FLOAT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "float32") }, "TEXT": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "string") }, "VARCHAR": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "string") }, "CHAR": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "string") }, "CLOB": func(ct gorm.ColumnType) string { n, _ := ct.Nullable(); return nullablePtr(n, "string") }, "UUID": func(ct gorm.ColumnType) string { return "datatypes.UUID" }, "JSON": func(ct gorm.ColumnType) string { return "datatypes.JSONMap" }, "JSONB": func(ct gorm.ColumnType) string { return "datatypes.JSONMap" }, "BLOB": func(gorm.ColumnType) string { return "[]byte" }, "DATE": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "time.Time") }, "DATETIME": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "time.Time") }, "TIMESTAMP": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "time.Time") }, "DURATION": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "time.Duration") }, "INTERVAL": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "time.Duration") }, "NUMERIC": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "float64") }, "DECIMAL": func(ct gorm.ColumnType) string { n, _ := ct.Nullable() return nullablePtr(n, "float64") }, }
TypeMap exposes the SQLite data type mapping used by the generator.
Functions ¶
func TableNames ¶
TableNames returns user-defined (non-internal) tables for SQLite.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.