entity-stream-queries
Installation
SKILL.md
Read packages/state/skills/stream-db/SKILL.md first for StreamDB and query basics.
Electric Agent Runtime Entity Stream Queries
Use direct typed queries against db.collections.*.
Principles:
- Prefer
queryOnce(...)for one-shot reads anduseLiveQuery(...)or shared live query collections for reactive UI. - Do not add exported convenience read helpers for obvious queries. The query itself is already the API.
- Keep code helpers only for real invariants:
- manifest key builders
- typed event/write helpers
- shared product-facing projections such as the entity timeline query
- In runtime, tests, examples, and CLI code, favor direct queries over raw
toArrayscans when the read is naturally query-shaped. - Do not cast around
db.collections.*. The row types come from the schema.
Read these references as needed:
Related skills