Pipeline layers
Bronze
Raw source tables auto-created from extraction. You don’t write bronze models — Soria creates them when data is ingested.
Silver
Cleaned and typed data. Use explicit
CAST or :: type conversions. No JOINs allowed — joins belong in gold.Gold
Joined data across silver models. This is where you combine related datasets and build richer views.
Platinum
Aggregated, dashboard-ready views. Platinum models can include a
@dashboard chart config that controls how the data is visualized.Model structure
Every SQL model must include a header comment with a@category annotation. This tells Soria which category section the model belongs to on the dashboard home page.
Annotations
Layer rules
Silver models:- Use
SELECT * FROM sourceCTEs prefixed withsrc_— no transforms in the CTE itself. - Apply all type conversions with explicit
CAST(col AS type)orcol::typesyntax. - No
JOINstatements. Silver is for cleaning, not combining.
- Join across silver models to build richer datasets.
- Reference silver views using their schema-qualified names.
- Aggregate data into the final shape for charts.
- Optionally include a
@dashboardannotation with YAML chart configuration:
Creating and updating models
Usesql_model_save to create a new model or overwrite an existing one. After saving, Soria automatically:
- Commits the model file to GitHub and updates the pull request.
- Applies the view to your workspace’s data warehouse.
Path format
Thepath argument uses the format category_folder/model_name.sql. The path determines how the file is organized in the repository.
Listing and reading models
Usesql_model_list to see all models saved in a workspace:
sql_model_get to read the content of a specific model:
Deleting a model
Deleting a model removes it from the repository and drops the corresponding view from the warehouse. This cannot be undone without re-saving the model.
Exploring data before writing models
Usewarehouse_query to profile and explore data in the warehouse before you start writing a model. This is especially useful when you’re working with a new bronze source and need to understand its shape.
workspace_id to query production data directly.