mirror of
https://github.com/ent/ent.git
synced 2026-05-02 07:30:53 +03:00
entc/gen: add support for summing custom Go numeric types
This commit is contained in:
committed by
Ariel Mashraki
parent
ee4fa653fd
commit
c40ae45aee
@@ -122,6 +122,8 @@ func (*SQLite) cType(c *Column) (t string) {
|
||||
t = "json"
|
||||
case field.TypeUUID:
|
||||
t = "uuid"
|
||||
case field.TypeOther:
|
||||
t = c.typ
|
||||
default:
|
||||
panic(fmt.Sprintf("unsupported type %q for column %q", c.Type, c.Name))
|
||||
}
|
||||
@@ -303,6 +305,8 @@ func (d *SQLite) scanColumn(c *Column, rows *sql.Rows) error {
|
||||
case "varchar", "text":
|
||||
c.Size = DefaultStringLen
|
||||
c.Type = field.TypeString
|
||||
case "decimal", "numeric":
|
||||
c.Type = field.TypeOther
|
||||
}
|
||||
if defaults.Valid {
|
||||
return c.ScanDefault(defaults.String)
|
||||
|
||||
Reference in New Issue
Block a user