Important
Self-managed SingleStore will soon transition from version 9.1 RC to version 10. This new semantic versioning scheme will provide SingleStore with finer control over engine and feature releases that were not possible with the current versioning scheme.
In the interim, SingleStore 9.1 RC can be used to preview, evaluate, and provide feedback on the new and upcoming features in SingleStore 10 prior to its general availability. Ahead of this transition, SingleStore 9.0 is recommended for production workloads, which can later be upgraded to SingleStore 10.
Wasm Data Type Coercions
On this page
The following table describes how database types are coerced to and from Wasm ABI types when using explicitly-typed UDFs/TVFs.
|
SingleStore Data Type |
Wasm Basic ABI Type |
Wasm Canonical ABI Type |
|---|---|---|
|
ARRAY |
list<. | |
|
BIGINT |
i64 |
i64 |
|
BINARY |
u32 |
u32 |
|
BINARY(. |
list<u8> | |
|
BIT | ||
|
BLOB |
list<u8> | |
|
BOOL |
i32 |
u8 |
|
CHAR |
i32 |
char |
|
CHAR(. |
string | |
|
DATE | ||
|
DATETIME | ||
|
DATETIME(6) | ||
|
DECIMAL | ||
|
DOUBLE |
f64 |
float64 |
|
ENUM | ||
|
FLOAT |
f32 |
float32 |
|
GEOGRAPHY |
string (WKT format) | |
|
GEOGRAPHYPOINT |
string (WKT format) | |
|
INT |
i32 |
i32 |
|
JSON |
string | |
|
LONGBLOB |
list<u8> | |
|
LONGTEXT |
string | |
|
MEDIUMBLOB |
list<u8> | |
|
MEDIUMINT |
i32 |
i32 |
|
MEDIUMTEXT |
string | |
|
RECORD |
record | |
|
SET | ||
|
SMALLINT |
i32 |
i16 |
|
TEXT |
string | |
|
TIME | ||
|
TIME(6) | ||
|
TIMESTAMP |
i64 |
i64 |
|
TIMESTAMP(6) |
i64 |
i64 |
|
TINYBLOB |
list<u8> | |
|
TINYINT |
i32 |
i8 |
|
TINYTEXT |
string | |
|
VARBINARY |
list<u8> | |
|
VARCHAR |
string | |
|
YEAR |
i32 |
i32 |
Remarks
-
Wasm does not support Base-10 numeric or date-time data types.
You must specify/cast these data types to ABI-supported data types. -
The
GEOGRAPHYandGEOGRAPHYPOINTdata types are converted to strings using the WKT representation. -
SingleStore recommends casting the
ENUMdata type to strings. -
Coercions to/from canonical ABI string types require that the data be encoded using multi-byte UTF-8 (
utf8mb3orutf8mb4collations).
Last modified: