update dialect
This commit is contained in:
parent
ba752f07e8
commit
e999912036
|
@ -993,9 +993,9 @@ WHERE c.relkind = 'r'::char AND c.relname = $1%s AND f.attnum > 0 ORDER BY f.att
|
|||
col.Indexes = make(map[string]int)
|
||||
|
||||
var colName, isNullable, dataType string
|
||||
var maxLenStr, colDefault, numPrecision *string
|
||||
var maxLenStr, colDefault, numPrecision, numRadix *string
|
||||
var isPK, isUnique bool
|
||||
err = rows.Scan(&colName, &colDefault, &isNullable, &dataType, &maxLenStr, &numPrecision, &isPK, &isUnique)
|
||||
err = rows.Scan(&colName, &colDefault, &isNullable, &dataType, &maxLenStr, &numPrecision, &numRadix, &isPK, &isUnique)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
@ -1026,7 +1026,7 @@ WHERE c.relkind = 'r'::char AND c.relname = $1%s AND f.attnum > 0 ORDER BY f.att
|
|||
col.Nullable = (isNullable == "YES")
|
||||
|
||||
switch strings.ToLower(dataType) {
|
||||
case "character varying", "character":
|
||||
case "character varying", "character", "varchar":
|
||||
col.SQLType = core.SQLType{Name: core.Varchar, DefaultLength: 0, DefaultLength2: 0}
|
||||
case "timestamp without time zone":
|
||||
col.SQLType = core.SQLType{Name: core.DateTime, DefaultLength: 0, DefaultLength2: 0}
|
||||
|
@ -1047,7 +1047,7 @@ WHERE c.relkind = 'r'::char AND c.relname = $1%s AND f.attnum > 0 ORDER BY f.att
|
|||
if startIdx != -1 && strings.HasSuffix(dataType, ")") {
|
||||
length := dataType[startIdx+8 : len(dataType)-1]
|
||||
l, _ := strconv.Atoi(length)
|
||||
col.SQLType = core.SQLType{Name: "varchar", DefaultLength: l, DefaultLength2: 0}
|
||||
col.SQLType = core.SQLType{Name: "VARCHAR", DefaultLength: l, DefaultLength2: 0}
|
||||
} else {
|
||||
col.SQLType = core.SQLType{Name: strings.ToUpper(dataType), DefaultLength: 0, DefaultLength2: 0}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue