Doel
Use the Element request-local DuckDB connection for local SQL, joins, dataframe registration, and table-shaped Element output.
Elements runtime reference / Local SQL
duckdbUse the Element request-local DuckDB connection for local SQL, joins, dataframe registration, and table-shaped Element output.
def run(..., duckdb): duckdb.execute(sql, parameters=None)
Use the Element request-local DuckDB connection for local SQL, joins, dataframe registration, and table-shaped Element output.
duckdb.executeduckdb.sqlduckdb.registerworkspaceUse these fields as the Python call arguments or keyword payload for this helper.
{
"entrypoint": "def run(params, duckdb, workspace): ...",
"localDatabase": "{workspace}/element.duckdb",
"tableOutput": {
"table": "totals"
}
}
| Field | Description |
|---|---|
duckdb | Named entrypoint parameter injected as a duckdb.DuckDBPyConnection backed by {workspace}/element.duckdb. |
workspace | Optional named entrypoint parameter with the writable scratch directory for the current run. |
methods | Normal DuckDBPyConnection methods such as execute, sql, register, from_df, read_csv, and read_parquet. |
{
"table": "totals"
}
def run(params, duckdb, workspace):
duckdb.execute(
"CREATE TABLE totals AS SELECT 1 AS id, ? AS value",
[params["value"]]
)
return {"table": "totals"}