Skip to content

Analytics overview

Analytics is the default landing page at /. It runs read-only SQL over the tables in one profile through the backend’s DataFusion analytics engine and renders the result as a table or an ECharts chart.

It is intended for totals, grouped reports, trends, comparisons, and other questions that need several rows or tables at once. It does not edit data and does not expose deleted rows or physical column names; the semantics of the query engine are described in the server chapter How Analytics works.

The page is assembled from four HTTP endpoints:

Method Route Purpose
GET / renders the analytics page
GET /api/profiles returns the profile options for the selector
POST /api/catalog returns the schema catalog for one profile
POST /api/query runs one query and returns table or chart markup

The profile selector is fed by TableDefinition.GetProfileTree, so it lists only profiles the caller may read. The catalog and query endpoints require a session; an anonymous caller sees the page shell but is told to sign in before listing profiles or loading a schema.

The page has three parts:

  1. Profile selector — chooses the profile whose tables are in scope.
  2. Catalog sidebar — after a profile is chosen, lists the profile’s tables, their columns and links, a starter query per table, and an LLM-ready schema context.
  3. Query area — the SQL textarea, a row limit, and the chart-type selector.

Selecting a profile posts profile_name to /api/catalog; the returned schema then populates the sidebar. Clicking a column in the sidebar inserts its quoted identifier into the SQL box.

See Writing queries for the query rules and Results and charts for how output is rendered.

Analytics has no permission of its own. It reuses table read grants: the catalog contains only tables the caller may read, and an unreadable table is absent from the SQL namespace entirely. Two roles can therefore receive different catalogs for the same profile.