Skip to content
Playground(another site)

bynk.types.query_at_boundary

Error A Query type appears in a storable or boundary-crossing position — a query is built and executed in place, never persisted or sent (ADR 0115).

A Query[T] is a lazy read over an agent's stored data: nothing runs until a terminal such as .collect() executes it, in the agent that owns the data. Persisted or sent, it would be a description of a read with nothing to read from. A helper may take or return one, but it is refused as a record, sum or event field, an agent key or store field, a capability operation, or a handler's parameter or result. Run it and keep or send the List or Option it gives. A Stream has its own rule: bynk.types.stream_at_boundary.

Example

type Order = { id: String, total: Int }
type Report = {
orders: Query[Order], // ✗ a lazy read is not data
}
type Report = {
orders: List[Order], // ✓ run the query, keep its result
}

In the Book

See also

  • Every code in its category, Type checking, on the diagnostic index.
  • bynk explain bynk.types.query_at_boundary shows the same from the installed toolchain, without a network.