Views
A view is a YAML file that packages one or more cubes into a single, curated dataset. Views are what end users — and the Streya agent — query; cubes stay behind the scenes.
File structure
Section titled “File structure”# view name: "sales_analytics"
title: Sales Analyticsdescription: > One row per (month × customer × product), 5 years of history. Use for: revenue trends, customer-mix shifts, product-level pricing analysis. Numbers reconcile to ERP at the monthly grain only.public: true # views default to public
cubes: - join_path: orders includes: "*" excludes: - internal_id prefix: true
- join_path: orders.customers includes: - name - segment - lifetime_value prefix: true
# Optionalextends: base_view_namemeta: {}Metadata
Section titled “Metadata”| Property | Type | Description |
|---|---|---|
title | string | Human-readable display name. |
description | string | The agent’s primary entry point to this dataset — what it is, its grain, and when to use it. See writing good descriptions. |
public | boolean | Whether end users see the view. Defaults to true. Set false for internal or in-development views. |
meta | object | Free-form metadata. |
extends | string | Inherit from another view and override selectively. |
access_policy | object | Column- and row-level access rules. See access policies. |
The cubes array
Section titled “The cubes array”Each entry pulls fields from a cube into the view.
join_path (required)
Section titled “join_path (required)”Which cube to include, optionally traversing joins with dot notation. Each segment must match a join defined in the cube schema.
cubes: - join_path: orders # the orders cube itself - join_path: orders.customers # customers, joined through orders - join_path: orders.order_items.products # two hopsincludes / excludes
Section titled “includes / excludes”Control which dimensions and measures are exposed.
# Explicit allowlist — when only a subset is relevant- join_path: orders includes: - status - created_at - total_revenue
# Everything except — when most fields are relevant- join_path: orders includes: "*" excludes: - internal_id - debug_timestampexcludes takes precedence over includes.
prefix
Section titled “prefix”Whether field names are prefixed with the cube name (orders.status vs status).
- join_path: orders prefix: true # fields appear as orders_status, orders_count, …Guideline: prefix: true for multi-cube views (avoids name collisions and shows provenance); prefix: false for single-cube views (cleaner names).
Common patterns
Section titled “Common patterns”Single-cube view
Section titled “Single-cube view”title: Customer Listdescription: All customers with their profile fields. Use for lookups and segmentation counts.cubes: - join_path: customers includes: "*" prefix: falseMulti-cube analytics view
Section titled “Multi-cube analytics view”title: Sales Analyticsdescription: > Order lines enriched with customer and product attributes. Use for revenue analysis by customer segment, category, or brand.cubes: - join_path: orders includes: "*" prefix: true - join_path: orders.customers includes: [name, segment, lifetime_value] prefix: true - join_path: orders.order_items.products includes: [name, category, brand] prefix: true