CSVFileSource
CSVFileSources let you query a local CSV file directly with SQL — no database required.
The file is loaded into an in-memory DuckDB connection and exposed as a view named
after the source, so models can SELECT from it like any other table. Use this for
small, version-controlled datasets; for CSVs produced by a command, use a
seeds entry on a database source instead.
Example
sources:
- name: products_csv
type: csv
file: data/products.csv
models:
- name: products
source: ${ref(products_csv)}
sql: SELECT * FROM products_csv
Attributes
| Field | Type | Default | Description |
|---|---|---|---|
| path | string | None | A unique path to this object |
| name | string | None | The unique name of the object across the entire project. |
| file_path | string | None | The path to the file that contains the object definition. |
| type | string | None | |
| file | string | None | Path to the CSV file, relative to the project directory. |
| delimiter | string | , | Character separating values in the file. |
| encoding | string | utf-8 | Text encoding of the CSV file. |
| has_header | boolean | True | Whether the first row of the file contains column names. |