Skip to content
Vibedata

Work across more than one platform

Make a dbt macro work on DuckDB and Microsoft Fabric

  • When a macro's SQL is written for one dialect and silently produces wrong results on the other.
  • When the same macro needs to compile and return equivalent results on both a local project and the Fabric estate.

Make a dbt macro produce equivalent output on DuckDB and Microsoft Fabric by isolating the dialect-specific SQL behind adapter dispatch. Covers making the macro portable, not changing what it computes.

Area
Transformation
Runs on
  • Microsoft Fabric Lakehouse
  • Microsoft Fabric Warehouse
  • MotherDuck
  • DuckDB
Built with
  • dbt
Readiness
SupportedEverything this Recipe composes runs today, without a case that proves this exact shape.

Sample This Recipe has not been materialized in the Cookbook repository yet. Its trigger, description, prompt, agent guidance and acceptance conditions, and the explanation below, are prototype drafts. Its name, job, area and readiness come from the reconciled Cookbook seed snapshot. Readiness is a separate question from this one: it says whether the capability exists, not whether the writing has been reviewed.

Use this Recipe

Use the VibeData Recipe `cross-platform-dbt-macro` at https://getvibedata.ai/cookbook/cross-platform-dbt-macro Read the Recipe and execute it in the context of the current Intent.

Recipe id cross-platform-dbt-macro · Not yet materialized in the Cookbook repository, so the pointer addresses this page.

Verified by

What has to be observably true before this Recipe is finished.

  • the macro returns the same result on DuckDB and on Fabric for the same inputs
  • the macro's dialect-specific branches are isolated behind adapter dispatch, not duplicated call sites
  • a model calling the macro builds clean on both targets
  • no caller needs to change how it invokes the macro
Recipe promptThe task specification the agent reads. Reference only — it is not what you copy.
Deliver: Make a dbt macro work on DuckDB and Microsoft Fabric.

Make a dbt macro produce equivalent output on DuckDB and Microsoft Fabric by isolating the dialect-specific SQL behind adapter dispatch. Covers making the macro portable, not changing what it computes.

Execute inside the current Intent. Its Domain, repository, platform, environment and attached sources are the context for this work — read them rather than asking for them.

The work is done when:
- the macro returns the same result on DuckDB and on Fabric for the same inputs
- the macro's dialect-specific branches are isolated behind adapter dispatch, not duplicated call sites
- a model calling the macro builds clean on both targets
- no caller needs to change how it invokes the macro

Report the evidence for each condition above with the result. A condition you cannot meet is something to say, not something to work around.
Agent guidanceHow the agent approaches the work, and what it will not do.

Establish which platform is authoritative today and what in the project is platform-specific. Build against the target in an isolated copy and reconcile the two runs against each other before anything is cut over.

Composes

  • dbt model authoring and layering
  • dbt in the project
  • isolated-copy execution and gate verification

Asks first

Semantic decisions the Intent cannot supply. Never context Studio already holds.

  • which Fabric target this work lands on, when the Domain carries both a Lakehouse and a Warehouse

Guardrails

  • Build in an isolated copy. Production is read, never written.

What you need

  • Microsoft Fabric Lakehouse, Microsoft Fabric Warehouse, MotherDuck, or DuckDB.
  • A dbt project you can build, and read access to the models it starts from.
  • dbt in the project, or the intent to add it.

How it goes

  1. Name both platforms, and which one is authoritative today.
  2. Let it read what in the project is platform-specific and what is not.
  3. Review the plan before anything is rebuilt.
  4. Build and run against the target in an isolated copy.
  5. Reconcile the two runs against each other, at the grain the consumers read.
  6. Read the acceptance conditions before you cut over, not after.

What you end up with

The deliverable, in your own repository, as transformation work a reviewer who knows the project reads as native to it. Alongside it, the evidence for every one of the acceptance conditions above — which is the part that is still there in three weeks when somebody asks.