mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-24 03:09:22 -06:00
Tidying up
This commit is contained in:
@@ -144,18 +144,32 @@ func FromSqlType(sqlType sql.Type) (TypeInfo, error) {
|
||||
switch queryType {
|
||||
case sqltypes.Null:
|
||||
return UnknownType, nil
|
||||
case sqltypes.Int8, sqltypes.Int16, sqltypes.Int24, sqltypes.Int32, sqltypes.Int64:
|
||||
case sqltypes.Int8:
|
||||
// MySQL allows only the TINYINT type to have a display width, so it's the only
|
||||
// integer type that needs to be checked for it's underlying NumberType data.
|
||||
numberType, ok := sqlType.(sql.NumberType)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("expected sql.NumberType, but received: %T", sqlType)
|
||||
}
|
||||
return &intType{numberType}, nil
|
||||
case sqltypes.Uint8, sqltypes.Uint16, sqltypes.Uint24, sqltypes.Uint32, sqltypes.Uint64:
|
||||
numberType, ok := sqlType.(sql.NumberType)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("expected sql.NumberType, but received: %T", sqlType)
|
||||
}
|
||||
return &uintType{numberType}, nil
|
||||
case sqltypes.Int16:
|
||||
return Int16Type, nil
|
||||
case sqltypes.Int24:
|
||||
return Int24Type, nil
|
||||
case sqltypes.Int32:
|
||||
return Int32Type, nil
|
||||
case sqltypes.Int64:
|
||||
return Int64Type, nil
|
||||
case sqltypes.Uint8:
|
||||
return Uint8Type, nil
|
||||
case sqltypes.Uint16:
|
||||
return Uint16Type, nil
|
||||
case sqltypes.Uint24:
|
||||
return Uint24Type, nil
|
||||
case sqltypes.Uint32:
|
||||
return Uint32Type, nil
|
||||
case sqltypes.Uint64:
|
||||
return Uint64Type, nil
|
||||
case sqltypes.Float32:
|
||||
return Float32Type, nil
|
||||
case sqltypes.Float64:
|
||||
|
||||
Reference in New Issue
Block a user