Two Common Paths
| Path | Best for |
|---|---|
| Query the tables directly | App-specific read paths, joins, dashboards, and custom SQL logic |
| Mount generated routes | Fast internal APIs over stream tables with pagination and filtering |
Direct Table Queries
Export the stream tables from your schema package, then query them with Drizzle like any other app table.Generated Routes
If you mountedmountStreamRoutes(...), each stream gets a generated route family under your chosen prefix.
Typical uses:
- list recent token transfer rows
- filter token accounts by
mintorowner - expose stream-backed data to internal tools quickly
api.filters configuration.
When To Use Generated Routes
Generated routes are a good fit when:- you want a fast internal API over indexer tables
- the stream schema is already close to the response shape you need
- pagination and simple filters are enough
- you need joins across multiple indexed tables
- you need auth, aggregation, or business-specific response shapes
- you want non-stream resources mixed into the same endpoint
Practical Recommendation
For most apps:- query tables directly inside the backend for core product endpoints
- use generated routes for tooling, admin views, or low-friction internal APIs