Add NullJSON and JSON types, fix randomize struct

This commit is contained in:
Patrick O'brien 2016-09-08 19:07:33 +10:00
parent ce8573eccd
commit 757cbde016
5 changed files with 224 additions and 8 deletions
bdb/drivers

View file

@ -281,8 +281,10 @@ func (p *PostgresDriver) TranslateColumnType(c bdb.Column) bdb.Column {
c.Type = "null.Float32"
case "bit", "interval", "bit varying", "character", "character varying", "cidr", "inet", "macaddr", "text", "uuid", "xml":
c.Type = "null.String"
case "bytea", "json", "jsonb":
c.Type = "[]byte"
case "bytea":
c.Type = "null.Bytes"
case "json", "jsonb":
c.Type = "null.JSON"
case "boolean":
c.Type = "null.Bool"
case "date", "time", "timestamp without time zone", "timestamp with time zone":
@ -305,7 +307,7 @@ func (p *PostgresDriver) TranslateColumnType(c bdb.Column) bdb.Column {
case "bit", "interval", "uuint", "bit varying", "character", "character varying", "cidr", "inet", "macaddr", "text", "uuid", "xml":
c.Type = "string"
case "json", "jsonb":
c.Type = "json.RawMessage"
c.Type = "types.JSON"
case "bytea":
c.Type = "[]byte"
case "boolean":