ent: add blob tyoe

Reviewed By: idoshveki

Differential Revision: D16600425

fbshipit-source-id: 04c6fe39f9b3b628a1e79eb3063188f582d9e504
This commit is contained in:
Ariel Mashraki
2019-08-01 07:42:14 -07:00
committed by Facebook Github Bot
parent 2d962d5cba
commit c203f043cf
19 changed files with 302 additions and 76 deletions

View File

@@ -176,6 +176,8 @@ func (c *Column) MySQLType(version string) (t string) {
t = "bigint"
case field.TypeUint, field.TypeUint64:
t = "bigint unsigned"
case field.TypeBytes:
t = "blob"
case field.TypeString:
size := c.Size
if size == 0 {
@@ -211,6 +213,8 @@ func (c *Column) SQLiteType() (t string) {
t = "integer"
case field.TypeInt64, field.TypeUint64:
t = "bigint"
case field.TypeBytes:
t = "blob"
case field.TypeString:
size := c.Size
if size == 0 {
@@ -279,6 +283,8 @@ func (c *Column) ScanMySQL(rows *sql.Rows) error {
c.Type = field.TypeFloat64
case "timestamp":
c.Type = field.TypeTime
case "blob":
c.Type = field.TypeBytes
case "varchar":
c.Type = field.TypeString
size, err := strconv.Atoi(parts[1])