Feature: SQL Parameters

Use SQL Parameters to fetch specific data from your data warehouse

SQL Parameters let you expose a UI to your users that affects the SQL query run against your data warehouse, while keeping maps fast with in-browser aggregations.

The problem

Honeycomb Maps loads your data once and runs aggregations in the browser, so maps stay fast and scale to thousands of simultaneous users.

But a single saved query often pulls far more data than any one user needs. This slows the initial load and strains the warehouse.

The solution

SQL Parameters are placeholders you drop into a data source query and then expose to users as interface components. Data teams keep control over the SQL that hits the warehouse, while users specify exactly the data they need.

Filtering is pushed down into the warehouse, so each map loads only the relevant rows. This unlocks fast visualizations on larger, more complex datasets.

Push filtering into the warehouse

A first cut of filtering happens at the data source, so you only pull the rows a user actually cares about, like a city, a market, or a time range, instead of the entire dataset.

Creators keep control, users get flexibility

Data teams own the SQL that hits the warehouse while map viewers (who may not write SQL) change exactly the values they need through a simple UI.

Stay fast and scalable

Smaller, targeted queries mean faster initial loads and lower warehouse costs, while in-browser aggregation keeps interactions snappy with no network round-trips.

How SQL Parameters work

1
Add parameters to your data source queryWhen writing a data source query, wrap a placeholder in curly brackets — like {{ market_parameter }} — wherever you want a value the user can control.
2
Set defaults and typesGive each parameter a default value (or leave it null) and a type: text, number, or date and time. Wrap an entire clause in square brackets [[ ]] to omit it when the parameter is null.
3
Expose a control componentAdd a UI component to the map that controls the parameter. Use a free-form input, or constrain it to certain ranges for numbers or specific values for text.
4
Users select and reloadMap viewers change the parameter with the control component and click reload. Honeycomb runs a new query against the warehouse, fetching exactly the data they need.

Example SQL with Parameters

select *
from operations.public.fact_deliveries
where market = {{ market_parameter }}
[[ and delivered_at >= {{ start_date }} ]];

Curly brackets {{ }} mark a parameter. Square brackets [[ ]] wrap a clause that is omitted entirely when its parameter is null.