Skip to content

Export

Exports write the result of a SELECT to a Parquet/CSV/JSON file at a cloud or local location.

-- definitions/dump.sqlx
config {
type: "export",
export: { location: "s3://bucket/orders/", format: "parquet", overwrite: true }
}
SELECT * FROM ${ref("orders")}

On BigQuery this compiles to a native EXPORT DATA statement (gs:// only). On Postgres/Supabase the runner performs the export via DuckDB.

Naming the export:

By default an export is named after its file: definitions/dump.sqlx creates an export called dump. Set name in the config to override that. The name also sets the file the export writes: unless export.filename is set, the output is <location>/<name>.<format> (on BigQuery, <name>_*.<format>, since it can write several files):

-- definitions/exports/orders.sqlx
config {
type: "export",
name: "orders_extract",
export: { location: "s3://bucket/orders/", format: "parquet" }
}
SELECT * FROM ${ref("orders")}

This writes s3://bucket/orders/orders_extract.parquet.

  • ActionBuilder‹Export›

    ↳ Export

▸ query(contextable: Contextable‹IActionContext, string›): this

Sets the SELECT whose result is exported.

Parameters:

NameType
contextableContextable‹IActionContext, string›

Returns: this