Skip to main content

datatype

Data Type

Mysql

The data obtained by Engine Server from MySQL will be processed and returned using database/sql. The type of each column of MySQL will be mapped to a type of Engine Server. The mapping relationship is shown in the following table.

MySQL Column TypeGo database/sql Type (ColumnType)Go Native Type (Scan())Engine Server Type
TINYINTINTint8INT
SMALLINTINTint16INT
MEDIUMINTINTint32INT
INT(INTEGER)INTint32INT
BIGINTINTint64INT
FLOATFLOATfloat32FLOAT
DOUBLEFLOATfloat64FLOAT
DECIMALDECIMALstring,float64 or sql.NullFloat64FLOAT
CHARCHARstring or sql.NullStringSTRING
VARCHARVARCHARstring or sql.NullStringSTRING
TEXT(TINYTEXT, etc.)TEXTstring or sql.NullStringSTRING
BLOB(TINYBLOB, etc.)BLOB[]byte or sql.NullStringBYTES
DATEDATEtime.TimeINVALID
DATETIMEDATETIMEtime.TimeINVALID
TIMESTAMPTIMESTAMPtime.TimeINVALID
TIMETIMEtime.TimeINVALID
ENUMVARCHARstringINVALID
SETVARCHARstringINVALID
BITBIT[]byte, boolINVALID
JSONVARCHARstringINVALID

Elasticsearch

The data obtained by Engine Server from Elasticsearch currently only processes three types: text, number, and boolean.

ES Field TypeEngine Server Type
textSTRING
numberFLOAT
booleanBOOL
datetimeINVALID
geopointINVALID
geoshapeINVALID
IPINVALID
vectorINVALID

Milvus