|
|
@ -69,15 +69,17 @@ var ( |
|
|
|
Enum = "ENUM" |
|
|
|
Enum = "ENUM" |
|
|
|
Set = "SET" |
|
|
|
Set = "SET" |
|
|
|
|
|
|
|
|
|
|
|
Char = "CHAR" |
|
|
|
Char = "CHAR" |
|
|
|
Varchar = "VARCHAR" |
|
|
|
Varchar = "VARCHAR" |
|
|
|
NVarchar = "NVARCHAR" |
|
|
|
NVarchar = "NVARCHAR" |
|
|
|
TinyText = "TINYTEXT" |
|
|
|
TinyText = "TINYTEXT" |
|
|
|
Text = "TEXT" |
|
|
|
Text = "TEXT" |
|
|
|
Clob = "CLOB" |
|
|
|
Clob = "CLOB" |
|
|
|
MediumText = "MEDIUMTEXT" |
|
|
|
MediumText = "MEDIUMTEXT" |
|
|
|
LongText = "LONGTEXT" |
|
|
|
LongText = "LONGTEXT" |
|
|
|
Uuid = "UUID" |
|
|
|
Uuid = "UUID" |
|
|
|
|
|
|
|
UniqueIdentifier = "UNIQUEIDENTIFIER" |
|
|
|
|
|
|
|
SysName = "SYSNAME" |
|
|
|
|
|
|
|
|
|
|
|
Date = "DATE" |
|
|
|
Date = "DATE" |
|
|
|
DateTime = "DATETIME" |
|
|
|
DateTime = "DATETIME" |
|
|
@ -100,7 +102,8 @@ var ( |
|
|
|
LongBlob = "LONGBLOB" |
|
|
|
LongBlob = "LONGBLOB" |
|
|
|
Bytea = "BYTEA" |
|
|
|
Bytea = "BYTEA" |
|
|
|
|
|
|
|
|
|
|
|
Bool = "BOOL" |
|
|
|
Bool = "BOOL" |
|
|
|
|
|
|
|
Boolean = "BOOLEAN" |
|
|
|
|
|
|
|
|
|
|
|
Serial = "SERIAL" |
|
|
|
Serial = "SERIAL" |
|
|
|
BigSerial = "BIGSERIAL" |
|
|
|
BigSerial = "BIGSERIAL" |
|
|
@ -131,6 +134,7 @@ var ( |
|
|
|
LongText: TEXT_TYPE, |
|
|
|
LongText: TEXT_TYPE, |
|
|
|
Uuid: TEXT_TYPE, |
|
|
|
Uuid: TEXT_TYPE, |
|
|
|
Clob: TEXT_TYPE, |
|
|
|
Clob: TEXT_TYPE, |
|
|
|
|
|
|
|
SysName: TEXT_TYPE, |
|
|
|
|
|
|
|
|
|
|
|
Date: TIME_TYPE, |
|
|
|
Date: TIME_TYPE, |
|
|
|
DateTime: TIME_TYPE, |
|
|
|
DateTime: TIME_TYPE, |
|
|
@ -147,11 +151,12 @@ var ( |
|
|
|
Binary: BLOB_TYPE, |
|
|
|
Binary: BLOB_TYPE, |
|
|
|
VarBinary: BLOB_TYPE, |
|
|
|
VarBinary: BLOB_TYPE, |
|
|
|
|
|
|
|
|
|
|
|
TinyBlob: BLOB_TYPE, |
|
|
|
TinyBlob: BLOB_TYPE, |
|
|
|
Blob: BLOB_TYPE, |
|
|
|
Blob: BLOB_TYPE, |
|
|
|
MediumBlob: BLOB_TYPE, |
|
|
|
MediumBlob: BLOB_TYPE, |
|
|
|
LongBlob: BLOB_TYPE, |
|
|
|
LongBlob: BLOB_TYPE, |
|
|
|
Bytea: BLOB_TYPE, |
|
|
|
Bytea: BLOB_TYPE, |
|
|
|
|
|
|
|
UniqueIdentifier: BLOB_TYPE, |
|
|
|
|
|
|
|
|
|
|
|
Bool: NUMERIC_TYPE, |
|
|
|
Bool: NUMERIC_TYPE, |
|
|
|
|
|
|
|
|
|
|
@ -163,7 +168,7 @@ var ( |
|
|
|
uintTypes = sort.StringSlice{"*uint", "*uint16", "*uint32", "*uint8"} |
|
|
|
uintTypes = sort.StringSlice{"*uint", "*uint16", "*uint32", "*uint8"} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// !nashtsai! treat following var as interal const values, these are used for reflect.TypeOf comparision
|
|
|
|
// !nashtsai! treat following var as interal const values, these are used for reflect.TypeOf comparison
|
|
|
|
var ( |
|
|
|
var ( |
|
|
|
c_EMPTY_STRING string |
|
|
|
c_EMPTY_STRING string |
|
|
|
c_BOOL_DEFAULT bool |
|
|
|
c_BOOL_DEFAULT bool |
|
|
@ -288,9 +293,9 @@ func SQLType2Type(st SQLType) reflect.Type { |
|
|
|
return reflect.TypeOf(float32(1)) |
|
|
|
return reflect.TypeOf(float32(1)) |
|
|
|
case Double: |
|
|
|
case Double: |
|
|
|
return reflect.TypeOf(float64(1)) |
|
|
|
return reflect.TypeOf(float64(1)) |
|
|
|
case Char, Varchar, NVarchar, TinyText, Text, MediumText, LongText, Enum, Set, Uuid, Clob: |
|
|
|
case Char, Varchar, NVarchar, TinyText, Text, MediumText, LongText, Enum, Set, Uuid, Clob, SysName: |
|
|
|
return reflect.TypeOf("") |
|
|
|
return reflect.TypeOf("") |
|
|
|
case TinyBlob, Blob, LongBlob, Bytea, Binary, MediumBlob, VarBinary: |
|
|
|
case TinyBlob, Blob, LongBlob, Bytea, Binary, MediumBlob, VarBinary, UniqueIdentifier: |
|
|
|
return reflect.TypeOf([]byte{}) |
|
|
|
return reflect.TypeOf([]byte{}) |
|
|
|
case Bool: |
|
|
|
case Bool: |
|
|
|
return reflect.TypeOf(true) |
|
|
|
return reflect.TypeOf(true) |
|
|
|