Skip to content

Import

Imports load a Parquet/CSV/JSON file into a table in the warehouse — the inverse of type: "export". The resulting table is ref()-able by downstream actions, so an import is a producer (unlike export, a terminal sink). It is config-only: no SQL body — the source is the file at location, the destination is the action’s target.

-- definitions/orders_in.sqlx
config {
type: "import",
import: { location: "s3://bucket/orders/*.parquet", format: "parquet", overwrite: true }
}
-- Note: no SQL should be present.

On BigQuery this compiles to a native LOAD DATA statement (gs:// only). On Postgres/Supabase the runner performs the load via DuckDB (read the file, write into the warehouse). Data is loaded as-is (no transform) — shape it in a downstream model.

Naming the import:

By default an import is named after its file: definitions/orders_in.sqlx loads into a table called orders_in. Set name in the config to override that. The file is loaded into a table with the new name, and other actions ref() it by that name, not by the filename:

-- definitions/imports/orders.sqlx
config {
type: "import",
name: "orders_raw",
import: { location: "s3://bucket/orders/*.parquet", format: "parquet" }
}
  • ActionBuilder‹Import›

    ↳ Import