← All use cases

One workbook from three systems

The numbers for one pack live in different places: stores in a local DuckDB file, the product catalogue in Postgres, locations in Databricks. You want one workbook, not three exports glued together by hand. Declare the tables as sources once, with the connection each lives on, and every query runs where its tables are.

Recorded from a real run: dre ls shows each tab’s connection offline, then one run reads DuckDB, Postgres and Databricks.

Recorded from a real run: dre ls shows each tab’s connection offline, then one run reads DuckDB, Postgres and Databricks.

↓ Download the workbook (three_engines.xlsx)

sources/shop.yml
version: 2
sources:
  - name: shop
    profile: shop_duck
    schema: main
    tables: [{name: stores}]
  - name: shop_pg
    profile: shop_pg
    schema: public
    tables: [{name: products}]
  - name: career_vista
    profile: databricks_oauth
    database: workspace
    schema: career_vista
    tables: [{name: locations}]
reports/three_engines/three_engines.yml
queries:
  - {query: tri_duck_stores, tab_name: DuckDB}
  - {query: tri_pg_products, tab_name: Postgres}
  - {query: tri_databricks_locations, tab_name: Databricks}
output:
  format: xlsx
  destination:
    - {profile: local, path: "out/three_engines-{{ run.date.yyyymmdd }}.xlsx"}
reports/three_engines/tri_pg_products.sql
select '{{ connection.type }}' as engine, count(*) as products
from {{ source('shop_pg', 'products') }}
terminal
dre ls -s three_engines
dre run three_engines