Jinja is the game changing feature of dbt Core that allows us to create dynamic SQL code. In addition to the standard Jinja library, dbt Core includes additional functions and variables to make working with dbt even more powerful out of the box.
See our original post, The Ultimate dbt Jinja Cheat Sheet, to get started with Jinja fundamentals like syntax, variable assignment, looping and more. Then dive into the information below which covers Jinja additions added by dbt Core.
This cheatsheet references the extra functions, macros, filters, variables and context methods that are specific to dbt Core.
dbt Core: Functions
These pre-defined dbt Jinja functions are essential to the dbt workflow by allowing you to reference models and sources, write documentation, print, write to the log and more.
dbt Core: Macros
These macros are provided in dbt Core to improve the dbt workflow.
dbt Core: Filters
These dbt Jinja filters are used to modify data types.
dbt Core: Project Context Variables
These dbt core "variables" such as config, target, source, and others contain values that provide contextual information about your dbt project and configuration settings. They are typically used for accessing and customizing the behavior of your dbt models based on project-specific and environment-specific information.
dbt Core: Run Context Variables
These special variables provide information about the current context in which your dbt code is running, such as the model, schema, or project name.
dbt Core: Context Methods
These methods allow you to retrieve information about models, columns, or other elements of your project.
Please contact us with any errors or suggestions.