Define and manage SQL models as YAML configurations using the Rudder CLI tool.
Available Plans
free
starter
growth
enterprise
4 minute read
This feature is in Alpha as part of RudderStack’s Early Access Program, where we work with early users and customers to test new features and get feedback before making them generally available.
Note that these features are functional but can change as we improve them. Make sure to contact the RudderStack team before using them in production.
The SQL Models feature in Rudder CLI lets you manage your Reverse ETL SQL model sources through a Git-based workflow. It lets you store your SQL model configurations as YAML files in Git repositories, and use standard Git workflows to collaborate on any changes.
This approach brings version control, collaboration, and review processes to your SQL model configurations, addressing key limitations of managing these resources solely through the UI.
Key features
Bi-directional management
Create new SQL model resources directly from CLI
Import existing SQL model sources from your workspace into Git
Validation and preview
Validate SQL syntax and connectivity before deployment
Preview query results to ensure correctness
Check primary key constraints and column mappings
Flexible configuration
Define SQL queries inline in YAML files or reference external .sql files
Support for multiple warehouse types (listed below)
Automation ready
GitHub Actions integration for CI/CD workflows
Dry-run capabilities to preview changes before applying them
For testing or development purposes only: Generate a Personal Access Token with Read-Write role
RudderStack recommends using a workspace-level Service Access Token for authentication.
Any action authenticated by a Personal Access Token will break if the user is removed from the organization or a breaking change is made to their permissions.
The SQL model resources need to be in the location specified in the apply command. If you don’t specify a location, the current directory is used as the project location.
The apply command is generic and it will sync all the available resources within the project (SQL models, Data Catalog, etc.).
A recommended directory structure for your CLI project is shown:
File discovery: The CLI recursively scans the specified directory for all .yaml and .yml files.
Flexible organization: You can organize files in any directory structure that makes sense for your project.
External SQL files: When using the file option in your YAML configurations, ensure the SQL files are accessible relative to the YAML file location.
Mixed resources: The CLI can manage SQL models alongside Data Catalog resources (events, properties, custom types, Tracking Plans) from the same project directory.
Next steps
See the following guides for working with SQL models using Rudder CLI:
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
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.
This site uses cookies to improve your experience. If you want to
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.