SQL data types
Last updated Oct 1, 2026 Basin Pipelines supports a set of primitive and composite data types for SQL transformations. These types can be used in stream schemas and SQL literals with automatic type inference.
Primitive types
| Pipelines | SQL Types | Example Literals |
|---|---|---|
bool |
BOOLEAN |
TRUE, FALSE |
int32 |
INT, INTEGER |
0, 1, -2 |
int64 |
BIGINT |
0, 1, -2 |
float32 |
FLOAT, REAL |
0.0, -2.4, 1E-3 |
float64 |
DOUBLE |
0.0, -2.4, 1E-35 |
string |
VARCHAR, CHAR, TEXT, STRING |
"hello", "world" |
timestamp |
TIMESTAMP |
'2020-01-01', '2023-05-17T22:16:00.648662+00:00' |
binary |
BYTEA |
X'A123' (hex) |
json |
JSON |
'{"event": "purchase", "amount": 29.99}' |
Composite types
In addition to primitive types, Basin Pipelines SQL supports composite types for more complex data structures.
List types
Lists group together zero or more elements of the same type. In stream schemas, lists are declared using the list type with an items field specifying the element type. In SQL, lists correspond to arrays and are declared by suffixing another type with [], for example INT[].
List values can be indexed using 1-indexed subscript notation (v[1] is the first element of v).
Lists can be constructed via [] literals:
SELECT [1, 2, 3] as numbers
Basin Pipelines provides array functions for manipulating list values, and lists may be unnested using the UNNEST operator.
Struct types
Structs combine related fields into a single value. In stream schemas, structs are declared using the struct type with a fields array. In SQL, structs can be created using the struct function.
Example creating a struct in SQL:
SELECT struct('user123', 'purchase', 29.99) as event_data FROM events
This creates a struct with fields c0, c1, c2 containing the user ID, event type, and amount.
Struct fields can be accessed via . notation, for example event_data.c0 for the user ID.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/basin-pipelines/sql-reference/sql-data-types/#page","headline":"SQL data types","description":"Supported data types in Basin Pipelines SQL","url":"https://developers.cloudflare.com/basin-pipelines/sql-reference/sql-data-types/","inLanguage":"en","image":"https://developers.cloudflare.com/basin-pipelines/sql-reference/sql-data-types/og.png?v=5aaab018cf0f7668","dateModified":"2026-10-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Query Basin Pipelines metrics for data ingested, processed, and delivered via the dashboard or GraphQL API. title: Metrics and analytics image: https://developers.cloudflare.com/basin-pipelines/observability/metrics/og.png?v=770b8767b4e352df
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/basin-pipelines/llms.txt
Use this file to discover all available pages before exploring further.
Docs