Create, update, and fetch details from custom SQL models.
RudderStack’s Models feature lets you create models by defining custom SQL queries. You can then run these queries on your warehouse and send the resulting data to specific destinations. You can create as many models and reuse them with their corresponding Reverse ETL sources.
With this feature, you can:
Build models with complex SQL queries via an intuitive UI.
Manage the views of all models synced to different destinations in one place.
Reuse the existing models in multiple connections.
You can find the Models option in the left navigation bar of the RudderStack dashboard that lets you view all existing models:
Creating a new model
Follow these steps to create a model:
Log in to the RudderStack dashboard.
Click Models in the left navigation bar and select New model.
Select the Reverse ETL source for the model and click Next.
Enter a name for the model.
Select your existing warehouse credentials or click Create Credentials from Scratch and enter the warehouse-specific details.
Your warehouse account must have the necessary user permissions for RudderStack to access it. For more information on these user permissions, refer to the Granting Permissions section of the relevant Reverse ETL source.
Once you select or add your warehouse credentials and click Next, RudderStack will validate them before you can proceed with the setup. For more information on these validations, refer to the FAQ section below.
Next, enter the Description for the model. Then, add your custom SQL query in the Query section.
Click Run Query to preview the result.
The Preview section displays the preview of the 50 resultant rows in a paginated format.
Click Next to create the model.
Once a model is created, you can use it to send the data from a Reverse ETL source to a specified destination. For more information and detailed steps, refer to the Importing Data using Models guide.
Updating an existing model
Follow these steps to update an existing model:
Click the model you want to update and select the Configuration tab.
Click Edit Configuration and make the required changes in Description and Query.
If you have edited the query, click Run Query to see if the new query generates the desired result.
Finally, click Finish to save your changes.
If you update a model’s query, you also need to check and update the relevant JSON mapping or Visual Data Mapping. To validate if the query is running fine, you can manually trigger a full sync.
To get details about an existing model, you can click it to see the options listed below:
Rename: Lets you rename the model by clicking on the edit icon next to the model’s name.
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
for the working of basic functionalities of the website. We also use third-party cookies that
analyze and understand how you use this website. These cookies will be stored in your browser
consent. You also have the option to opt-out of these cookies. But opting out of some of these
have an effect on your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.