Elementary can capture and store the compiled SQL of dbt microbatch incremental models inDocumentation Index
Fetch the complete documentation index at: https://docs.elementary-data.com/llms.txt
Use this file to discover all available pages before exploring further.
dbt_run_results.compiled_code. By default dbt does not surface compiled code for the microbatch strategy, so this column is empty for microbatch models until you enable the setup below.
How it works
Elementary provides an override macro for dbt’sget_incremental_microbatch_sql that captures the compiled SQL of each batch as it runs. The captured code is cached during the invocation and later written to dbt_run_results.compiled_code, so microbatch models populate this column the same way other incremental strategies do.
Enabling microbatch compiled code capture
Override the microbatch strategy macro in your project
Add a macro that delegates to Elementary’s implementation. Place it under your project’s
macros/ directory:Enable the dbt behavior flag
Add the This flag tells dbt to use your project-level override of the microbatch strategy with batched execution.
require_batched_execution_for_custom_microbatch_strategy flag to your dbt_project.yml:
