Skip to content

Commit

Permalink
add "year" and "uuid" types
Browse files Browse the repository at this point in the history
  • Loading branch information
lqs committed Aug 3, 2023
1 parent eb2285a commit 99fe0a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ func getType(fieldDescriptor fieldDescriptor) (goType string, fieldClass string,
case "float", "double", "decimal", "real":
goType = "float64"
fieldClass = "NumberField"
case "char", "varchar", "text", "tinytext", "mediumtext", "longtext", "enum", "datetime", "date", "time", "timestamp", "json", "numeric", "character varying", "timestamp without time zone", "timestamp with time zone", "jsonb":
case "char", "varchar", "text", "tinytext", "mediumtext", "longtext", "enum", "datetime", "date", "time", "timestamp", "json", "numeric", "character varying", "timestamp without time zone", "timestamp with time zone", "jsonb", "uuid":
goType = "string"
fieldClass = "StringField"
case "year":
goType = "int16"
fieldClass = "NumberField"
fieldDescriptor.Unsigned = true
case "binary", "varbinary", "blob", "tinyblob", "mediumblob", "longblob":
// TODO: use []byte ?
goType = "string"
Expand Down

0 comments on commit 99fe0a6

Please sign in to comment.