Word

query

A read of the app's data. It is written with rows, a plan, or with run, a function that reads through db alone.

Example

TypeScript
export const openNotes = query('openNotes', {
  access: allow((user) => user !== undefined),
  rows: notes.where({ body: { contains: 'open' } }).limit(input('limit')),
})

Options

OptionMeans
option.query.accessWho may call the query.
option.query.rowsThe plan that the query answers.
option.query.runThe function that answers the query.
option.query.aboutOne sentence on what the query is for.
option.query.inputThe fields that a call gives.
option.query.outputThe type of the answer.
option.query.liveWhether a page that reads the query follows its rows.
option.query.refreshHow often the query is asked again, for results that depend on the time.
option.query.heavyRuns the query on a query thread.
option.query.offerThe outside doors the query is offered to.
option.query.deprecatedMarks the query as going away, in the API description and in its answers.
option.query.systemGives the query full access, with the reason.
option.query.readsThe tables that a raw SQL read of the query reads.
option.query.countByFor whom the calls of the query are counted.
option.query.plainHolds the query to the plain form.
option.query.wasThe old name of the query, where it was renamed.

Returns

A function, openOrders(input), which answers at once. A call is handed to the engine.

Errors

code.T0010: it was called with no engine: nothing stands in the runtime slot.

See also

topic.words