Skip to main content
findAll caps at 2,000 rows, so aggregating in JavaScript silently undercounts on large tables. Push the math into the database instead: call zite.sql() from a backend workflow.

The pattern

One query per stat, returning typed results the frontend renders:
Render it on the frontend with recharts and the generated caller:

Rules

For the full zite.sql() rules (SDK-name quoting, link-table joins, date handling), see the database client. Two that bite most on dashboards:
  • Double-quote every identifier — FROM "Orders", not FROM Orders.
  • Join linked records through the link table ("ItemsOrders" with "itemsId" / "ordersId"), never on the JSONB field.