File Imports
import { Aside } from ‘@astrojs/starlight/components’;
A type: "import" action loads a Parquet / CSV / JSON file into a table in the warehouse — the symmetric inverse of type: "export". Unlike an export (a sink), an import is a producer: the table it creates is ref()-able by downstream models, just like a table or a declaration that actually carries data.
It’s a config-only action — there’s no SQL body (like a declaration). The source is the file at location; the destination is the action’s own target.
Need to produce the file first — download it, unzip it, reshape it? Pair the import with a python script action (1.20+) it depends on: the script stages the file in-DAG, the import loads it.
-- definitions/orders_in.sqlxconfig { type: "import", import: { location: "s3://my-bucket/orders/*.parquet", // exact source file or glob format: "parquet", // parquet | csv | json (json = JSONL) overwrite: true // default true }}-- definitions/clean_orders.sqlx — ref() the imported table like any other modelconfig { type: "table" }SELECT order_id, total FROM ${ref("orders_in")}How it runs per warehouse
Section titled “How it runs per warehouse”- BigQuery — compiles to native
LOAD DATA OVERWRITE|INTO <table> FROM FILES(format=…, uris=['gs://…']). In-engine, using the warehouse’s own GCS access.gs://only. - Postgres / Supabase — the CLI runs the import via DuckDB: it attaches the database read-write, then
CREATE TABLE … AS SELECT * FROM read_parquet('<location>')(replace) orINSERT INTO … SELECT …(append). DuckDB decodes the file; the table lands in your warehouse. Reads froms3://,gs://, Supabase Storage (its S3-compatible endpoint), or a local path — filling the gap where managed Postgres/Supabase can’t read Parquet itself.
MySQL/MariaDB import isn’t supported yet.
import options
Section titled “import options”| Field | Description |
|---|---|
location | Required. The exact source file/glob/URI to read (e.g. gs://b/orders/*.parquet). Used verbatim — unlike export, no filename is derived. ${} interpolation works. |
format | Required. parquet, csv, or json (JSONL). |
overwrite | true (default) replaces the table (drop + create). false appends (INSERT … SELECT) into an existing table. |
options | Format-specific passthrough (reserved). |
Schemes & per-warehouse validity
Section titled “Schemes & per-warehouse validity”| Scheme | BigQuery | Postgres / Supabase |
|---|---|---|
gs:// | ✓ (native) | ✓ (DuckDB) |
s3:// (incl. Supabase Storage) | ✗ | ✓ |
local://… or a path | ✗ | ✓ (handy for debugging) |
Storage credentials
Section titled “Storage credentials”Cloud sources on Postgres/Supabase read credentials from the storage section of the gitignored .df-credentials.json — the same section exports use (BigQuery uses its own GCS access; local:// needs none).