Skip to content
Playground(another site)

bynk.test.peek_not_bound

Error D1.peek is used anywhere but as the value of a let; the handle is what a case reads through.

D1.peek(<participant>.<Capability>) stands as the value of a let, and the case reads through the handle that binds. A D1.peek anywhere else, as an argument or the receiver of a call, has no handle to keep.

Example

tests/orders.test.bynk
suite shop.orders as system {
case "peeks" {
let rows <- D1.peek(shop.orders.Orders).all("SELECT id FROM orders", []) // ✗ the handle is not bound
let db = D1.peek(shop.orders.Orders) // ✓
expect true
}
}

In the Book

See also

  • The grammar rule it governs: case.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.peek_not_bound shows the same from the installed toolchain, without a network.