Export
Class: Export
Section titled “Class: Export”Exports write the result of a SELECT to a Parquet/CSV/JSON file at a cloud or local location.
-- definitions/dump.sqlxconfig { 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.sqlxconfig { type: "export", name: "orders_extract", export: { location: "s3://bucket/orders/", format: "parquet" }}SELECT * FROM ${ref("orders")}This writes s3://bucket/orders/orders_extract.parquet.
Hierarchy
Section titled “Hierarchy”-
ActionBuilder‹Export›
↳ Export
Methods
Section titled “Methods”Methods
Section titled “Methods”▸ query(contextable: Contextable‹IActionContext, string›): this
Sets the SELECT whose result is exported.
Parameters:
| Name | Type |
|---|---|
contextable | Contextable‹IActionContext, string› |
Returns: this