Creating a dbt™ Model
Last updated
Was this helpful?
Last updated
Was this helpful?
In this guide, you'll learn how to create your first dbt™ model in the Paradime IDE. By the end of this tutorial, you'll have a fully functional dbt™ model materialized in your data warehouse.
Estimated completion time: 10 minutes
Basic understanding of SQL and dbt™ concepts
Basic understanding of Git and version control concepts
Before creating a model in your dbt™ project, it's essential to work on a new branch to keep your main branch clean and stable. Use Git Lite to create a new branch:
Open Git Lite: Click the source control icon within the left panel of the IDE.
Create a New Branch: Using the dropdown, select + New Branch
and give it a practical name (e.g., my_first_dbt_model
).
Create a new .sql file for your dbt™ model:
Open your project file: Click the folder Icon (📁) in the left panel to view your dbt™ project files.
Create a new file: Right-click on the folder where you want to add your new file (e.g., models/sources
) and click New File
.
Name your file: Use a descriptive name that reflects the purpose of the model (e.g., nba_player_info.sql
).
With your new model open in the Code IDE, write SQL that transforms your data, using dbt's jinja syntax to reference sources and models dynamically. For example:
With your model written and previewed, it's time to materialize it in the data warehouse:
Execute dbt run: In the terminal at the bottom of your screen, run the command dbt run
.
Check for errors: Review any errors or warnings that appear during the build process and resolve them as needed.
Write your commit message: Use DinoAI's "Write Commit" feature to automatically generate a detailed commit message tailored to your specific code changes.
Commit and Push: Save your changes to your local repository, then push them to the remote repository to ensure your work is backed up and accessible.
Open a Pull Request (PR): Create a PR to allow your team to review and discuss the updates before merging.
Congratulations! You've successfully created your first dbt™ model in Paradime, from creating a new branch to committing your changes. Your model is now materialized in your data warehouse and ready for use.
After successfully building your model, commit and push your work using the learnings from the .
Next, we'll explore .