Skip to main content

Module table

Module table 

Source
Expand description

Table-query semantics — the renderer-agnostic sort/filter that every DataPlane implementation shares (ADR-0005).

This is where “sorting and filtering” live, not in a frontend and not duplicated in kaptein-core. A DataPlane maps its rows to Vec<Row> + a column-id schema, then hands the Query (sort + filter + window) to these functions. The result is a bounded Page, never a full materialization.

Functions§

cell_text
The display text of a cell, used for substring filtering and as the fallback sort key.
cmp_cells
Total order across heterogeneous cells. Numbers compare numerically, timestamps chronologically, everything else lexically by display text.
filter_rows
Filter rows by the Filter expression, as a case-insensitive substring match over every cell’s text. A None/empty expression keeps all rows. This is the cheap, predictable form of the Filter contract; the full expression language lands with the lens engine (Phase 2) — but the shape is already a serializable string.
sort_rows
Sort rows by the given SortSpec, resolving column against the column_ids schema (column id → cell index). An unknown column leaves order unchanged (stable). The sort is stable, so equal keys keep their identity order — deterministic across frontends and in headless/CI.