Private Beta
.md

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:

FieldRules
NameStarts with a letter; letters, digits, and dashes; up to 255 characters. Must be unique case-insensitively among the project's dataset tables and views.
DescriptionOptional, up to 1024 characters.
SQLOne read-only SELECT.

Example — severity counts across a findings dataset:

sql

Example — join subdomains with live services:

sql

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 a WITH ... SELECT CTE — 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

PropertyValue
ScopeCurrent state only; no history mode
FiltersNone; put predicates in the view SQL
Time rangeNone; filter on __ingested_at in the SQL if needed
Page sizeDefault 100, maximum 10,000
PaginationOpaque 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

sql

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

sql

#Unresolved subdomains

sql

#Aggregated rollup

sql

#Errors

ErrorCause
View reference unknown dataset or viewThe SQL references a name that is not a dataset or view in the project.
View dependency cycle detectedThe new or updated view would create a cycle.
View '<name>' is invalidExecution found the view no longer satisfies the policy.
View '<name>' cannot be evaluatedA column, type, or referenced relation changed.
Too many requestsThe per-user concurrency or rate limit was exceeded.