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 Type | Go database/sql Type (ColumnType ) | Go Native Type (Scan() ) | Engine Server Type |
---|---|---|---|
TINYINT | INT | int8 | INT |
SMALLINT | INT | int16 | INT |
MEDIUMINT | INT | int32 | INT |
INT (INTEGER ) | INT | int32 | INT |
BIGINT | INT | int64 | INT |
FLOAT | FLOAT | float32 | FLOAT |
DOUBLE | FLOAT | float64 | FLOAT |
DECIMAL | DECIMAL | string ,float64 or sql.NullFloat64 | FLOAT |
CHAR | CHAR | string or sql.NullString | STRING |
VARCHAR | VARCHAR | string or sql.NullString | STRING |
TEXT (TINYTEXT , etc.) | TEXT | string or sql.NullString | STRING |
BLOB (TINYBLOB , etc.) | BLOB | []byte or sql.NullString | BYTES |
DATE | DATE | time.Time | INVALID |
DATETIME | DATETIME | time.Time | INVALID |
TIMESTAMP | TIMESTAMP | time.Time | INVALID |
TIME | TIME | time.Time | INVALID |
ENUM | VARCHAR | string | INVALID |
SET | VARCHAR | string | INVALID |
BIT | BIT | []byte , bool | INVALID |
JSON | VARCHAR | string | INVALID |
Elasticsearch
The data obtained by Engine Server from Elasticsearch currently only processes three types: text
, number
, and boolean
.
ES Field Type | Engine Server Type |
---|---|
text | STRING |
number | FLOAT |
boolean | BOOL |
datetime | INVALID |
geopoint | INVALID |
geoshape | INVALID |
IP | INVALID |
vector | INVALID |