Query — Quickstart
From "I have a lens" to "I can read through the bridge" in three moves.
Three moves
Opt in with grants.query
Add query to the lens's grants block. Values match the standard access-rule
vocabulary:
Without this, beam.orders.query doesn't exist at the type level, and the
HTTP endpoint returns 403.
Push
push re-validates the config and makes query() available for the lens. No
ingest re-run is needed — query doesn't touch the vector index.
Call from your app
That's it — the call proxies through SemiLayer to your bridge, which runs the underlying SQL and streams rows back.
What comes back
Every query returns { rows, meta }:
Common errors
| Code | Meaning | Likely cause |
|---|---|---|
403 | Access denied | grants.query not set, or the user's role doesn't satisfy the rule |
422 SOURCE_QUERY_FAILED | Bridge rejected the query | Column doesn't exist, type mismatch, invalid operator |
502 SOURCE_UNREACHABLE | Your DB is down or unreachable | Credentials expired, network partition, source paused |
504 QUERY_TIMEOUT | Query took longer than 30s | Missing index on a where column, or pull-too-many-rows |
Next: Predicates — the full where grammar.