BountyHub Docs
Dataset Saved Views
Save reusable read-only SQL over project datasets and other views: nesting, cycle rules, validity, execution limits, and examples.
Dataset saved views
A saved view is a named, read-only SQL query over a project's datasets and other views. It is a logical definition, not materialized data: every execution runs against the current state, so a view automatically reflects new pushes.
Views are the UI's way to combine multiple datasets. A single-dataset query can
only reference dataset; a view can join any datasets in the project.
#Create a view
In Datasets → Views, choose New view and provide:
| Field | Rules |
|---|---|
| Name | Starts with a letter; letters, digits, and dashes; up to 255 characters. Must be unique case-insensitively among the project's dataset tables and views. |
| Description | Optional, up to 1024 characters. |
| SQL | One read-only SELECT. |
Example — severity counts across a findings dataset:
Example — join subdomains with live services:
Quote dataset and view names that contain dashes. See SQL reference for the query policy and result limits.
#SQL policy and references
Views use the same read-only SQL policy as direct queries:
- One read-only
SELECT(or aWITH ... SELECTCTE — views are validated with the SQL parser, so they are the place to use CTEs). - No DDL/DML,
COPY,ATTACH, file scans, catalog tables, or table functions. - Every referenced relation must be a dataset or an existing view in the same project.
Unlike a single-dataset query, a view may reference other views, as long as the dependency graph is acyclic. Creating or updating a view runs cycle detection across the project; a cycle fails with an error that names the cycle.
#Validity
Each view has valid and invalid_reason fields.
A view becomes invalid when:
- a dataset or view it references is deleted (for a deleted view this happens immediately; for a dataset, on the next execution);
- its stored SQL no longer satisfies the current SQL policy; or
- execution fails because a column or type no longer exists.
Executing an invalid view returns an error and records the reason. Saving the view again (after fixing the SQL or restoring the reference) resets it to valid. The Views list marks invalid views with a red status dot.
Deleting a view also invalidates views that depend on it.
#Execute a view
| Property | Value |
|---|---|
| Scope | Current state only; no history mode |
| Filters | None; put predicates in the view SQL |
| Time range | None; filter on __ingested_at in the SQL if needed |
| Page size | Default 100, maximum 10,000 |
| Pagination | Opaque cursor; ordered by the first column ascending |
Execution wraps the view as SELECT * FROM "<view>" and applies the same
pagination as direct SQL. If you need a particular order, make the sort key the
first projected column.
The Hub UI's Run view executes the first page and displays the rows. Use the
API (ExecuteDatasetView) to page through larger results.
#Update and delete
- Editing a view's name, description, or SQL is available through the API
(
UpdateDatasetView); the Hub UI currently supports create, run, and delete. - Deleting a view is permanent. Dependent views become invalid.
- Views are limited to 100 per project.
#Examples
#Findings by severity count
The page is sorted by the first column (findings) ascending, so the largest
groups appear last. Sort the returned rows client-side if you need descending.
#Live services
#Unresolved subdomains
#Aggregated rollup
#Errors
| Error | Cause |
|---|---|
View reference unknown dataset or view | The SQL references a name that is not a dataset or view in the project. |
View dependency cycle detected | The new or updated view would create a cycle. |
View '<name>' is invalid | Execution found the view no longer satisfies the policy. |
View '<name>' cannot be evaluated | A column, type, or referenced relation changed. |
Too many requests | The per-user concurrency or rate limit was exceeded. |
#Related
- SQL reference — the full query language and limits.
- API and CLI —
DatasetViewServicerequests. - Overview — current state vs history.