Skip to content

Commit

Permalink
Update example for overriding the ref macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeatty10 authored Mar 8, 2024
1 parent 5e44ceb commit 058ee59
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions website/docs/reference/dbt-jinja-functions/builtins.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ Using the `builtins` variable in this way is an advanced development workflow. U
:::

<VersionBlock firstVersion="1.5">

From dbt v1.5 and higher, use the following macro to extract user-provided arguments, including <code>version</code>, and call the <code>builtins.ref()</code> function with either a single <code>modelname</code> argument or both <code>packagename</code> and <code>modelname</code> arguments, based on the number of positional arguments in <code>varargs</code>:

From dbt v1.5 and higher, use the following macro to override the `ref` method available in the model compilation context to return a [Relation](/reference/dbt-classes#relation) with the database name overriden to `dev`.

It includes logic to extract user-provided arguments, including <code>version</code>, and call the <code>builtins.ref()</code> function with either a single <code>modelname</code> argument or both <code>packagename</code> and <code>modelname</code> arguments, based on the number of positional arguments in <code>varargs</code>.

<br /><br />

Expand Down

0 comments on commit 058ee59

Please sign in to comment.