Serving

What is a query decorator?

A query decorator names a reusable query you can call from an agent, from HTTP, or from another column.

Updated

How it works

  • The function states filters, order, and limit.
  • Callers pass arguments.
  • The same function is a tool, a route, or a column input.

What it is not

It is not ad-hoc SQL pasted into every handler.

query decorator: this, and the thing it is confused with

query decorator: this, and the thing it is confused with
ThisNot this
NamedYesA string in a handler
CallersAgents, HTTP, columnsOne route
ReturnsRowsAn untyped payload you reshape

Where Pixeltable fits

Pixeltable uses @pxt.query for that function, then add_query_route or pxt.tools() to expose it.

Questions

How does query decorator work?
The function states filters, order, and limit. Callers pass arguments. The same function is a tool, a route, or a column input.
What is query decorator often confused with?
It is not ad-hoc SQL pasted into every handler.