← cookbook/duckdb-to-instadash
4 min read·beginner·updated just now

DuckDB query → Instadash grid

Run a SQL query against a Parquet, CSV, or remote URL with DuckDB and pipe the result set straight to a versioned Instadash grid. ~3 lines of bash.

#sql#duckdb#analytics

What it builds

  • A single shell pipeline: duckdb | jq | instadash push
  • Reads local files, S3, R2, or remote HTTP Parquet directly
  • Default demo: top 100 NYC taxi trips by tip percentage
  • Sub-2-second end-to-end on the demo query

The key step

duckdb -json -c "
  SELECT customer_id, SUM(amount) AS lifetime_value
  FROM read_csv_auto('orders.csv')
  GROUP BY 1 ORDER BY 2 DESC LIMIT 500;
" \
  | jq -c '.[]' \
  | instadash push --name customer-ltv --public --tags duckdb,sql
note
This is the core of the recipe. The full file (including setup, error handling, and the surrounding scaffolding) lives in the GitHub folder linked below — clone or copy it directly.

Run it

bash⎘ copy
git clone https://github.com/instadashio/instadash-recipes
cd instadash-recipes/duckdb-to-instadash
brew install duckdb jq && npm i -g instadash
cp .env.example .env       # fill in your keys
./query.sh

Stack

duckdbbashjq
Full source on GitHub

README, runnable code, .env.example, dependencies — all in one folder.

↗ view on github
─ related recipesview all →