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. Empty cells indicate that automatic coercion is not available currently, and you must cast that SingleStore type to another data type for which data type conversion is available.

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 GEOGRAPHY and GEOGRAPHYPOINT data types are converted to strings using the WKT representation.

  • SingleStore recommends casting the ENUM data type to strings.

  • Coercions to/from canonical ABI string types require that the data be encoded using multi-byte UTF-8 (utf8mb3 or utf8mb4 collations).

Last modified: March 25, 2025

Was this article helpful?

Verification instructions

Note: You must install cosign to verify the authenticity of the SingleStore file.

Use the following steps to verify the authenticity of singlestoredb-server, singlestoredb-toolbox, singlestoredb-studio, and singlestore-client SingleStore files that have been downloaded.

You may perform the following steps on any computer that can run cosign, such as the main deployment host of the cluster.

  1. (Optional) Run the following command to view the associated signature files.

    curl undefined
  2. Download the signature file from the SingleStore release server.

    • Option 1: Click the Download Signature button next to the SingleStore file.

    • Option 2: Copy and paste the following URL into the address bar of your browser and save the signature file.

    • Option 3: Run the following command to download the signature file.

      curl -O undefined
  3. After the signature file has been downloaded, run the following command to verify the authenticity of the SingleStore file.

    echo -n undefined |
    cosign verify-blob --certificate-oidc-issuer https://oidc.eks.us-east-1.amazonaws.com/id/CCDCDBA1379A5596AB5B2E46DCA385BC \
    --certificate-identity https://kubernetes.io/namespaces/freya-production/serviceaccounts/job-worker \
    --bundle undefined \
    --new-bundle-format -
    Verified OK