GetData

GetData is the GroveStreams template-scoped query surface. Open it from the Components tree by right-clicking any template → GetData. A SQL editor opens pre-populated with SELECT * FROM <template>; press Execute and the result grid renders one row per component, one column per stream.

Every cell in that grid carries server-stamped origin metadata pointing back to the underlying temporal stream. Three things follow from that one fact:

  • Drill. Hover a cell to see a sparkline plus a compact grid of the most recent samples. Right-click to open the stream's full chart, diagnose a derivation, follow a foreign key, or locate the component in the tree.
  • Edit. Set Value writes back to the underlying temporal stream at the cell's original sample timestamp (replace) or at "now" (append). Same write path, same RBAC, same downstream derivation/rollup recalculation as any other sample ingestion.
  • Reason. The AI Assistant accepts cell selections as context. Click a cell, ask "Why is this value high?" — the assistant has the component, stream, value, and timestamp without you typing any of them.

Under the hood, GetData is plain GS SQL. The template name is a TEQ (Temporal Entity Query) table, columns are stream IDs, and the result is the same shape ODBC and OData see. The editor accepts any GS SQL you can write — WHERE, JOIN, temporal parameters, rollups, the lot.


Drag & Drop Into the SQL Editor

Drag any node from the Components or Model tree into the SQL editor to insert it at the cursor position. The dropped text adapts to which tree you dragged from (components are instances, model entries are abstract) and to modifier keys you hold during the drag. The editor also pads with surrounding spaces so the drop never butts against neighbouring tokens.

Hold no key for the ID form, Shift for UID, or Alt for NAME. While the cursor is over the SQL editor mid-drag, a small badge in the upper-right corner shows which form will be inserted (it updates live as you press or release modifier keys).

Drag source Plain (ID) Shift (UID) Alt (NAME)
Components tree — component node _component_id='<id>' _component_uid='<uid>' _component_name='<name>'
Components tree — stream under a component _id='<sid>' AND _component_id='<cid>' _uid='<suid>' AND _component_uid='<cuid>' _name='<sname>' AND _component_name='<cname>'
Model tree — template node catalog.templateId '<template-uid>' '<template-name>'
Model tree — stream under a template catalog.templateId.streamId '<template-stream-uid>' '<stream-name>'

The shape difference between trees is intentional. The Components tree represents instances, so its drops are filter clauses ready to paste after WHERE or AND. The Model tree represents abstract templates and template-level streams, so its drops are bare identifiers ready to paste into FROM, SELECT, or as a string literal in a comparison. Component ‘id’ for plain drops is fetched on demand when not cached on the tree node — a single lightweight call per drop.

This editor behaviour is wired on every codetextareafield instance, so the same drag & drop works in the standalone GS SQL Editor and Tester window, the View editor, and any future SQL editor surface.


The Result Grid

Execute runs the SQL and renders the result. The grid is built on standard ExtJS 6 with three GroveStreams-specific behaviors:

  • System columns hidden by default. _component_uid, _folder_path, _component_id, etc. are kept in the result but hidden in the grid header. Toggle them on via the column picker. Useful when you want to copy a UID without writing a separate query.
  • Origin metadata per column. The server attaches an origin block to each result column: source template, stream ID, FK target template (if any), derivation expression + dependents (if derived), PG OIDs (for ODBC clients), and writability. Cell-level UI affordances key off these flags — columns that aren't drillable simply don't surface a hover popover.
  • Tabbed. Each GetData tab is per-template. Open as many as you want; they dedupe by template so successive opens of the same template re-activate the existing tab.

Hover Cell Preview

Mouse over any drillable cell and a popover appears with:

  • Numeric stream — a 24-sample SVG sparkline, a 6-row recent-samples grid (timestamp + value, newest first), and the last value with a human "13s ago" age. The sparkline shows the shape; the grid shows the precise numbers.
  • Derived stream — the expression text in monospace, sparkline, recent-samples grid, plus a Diagnose chip. Diagnose opens a window with the dependents, cycle/stat per dep, and clickable links to each dependent's instance stream.
  • String / non-numeric stream — the recent-samples grid only (a sparkline of strings is a flat line; the grid is the visualization). You can see exactly when the value transitioned.
  • Foreign-key stream — a "FK → target template" header with the target component's UID, and a Follow FK chip that opens a new GetData tab on the target template filtered to that component.

Action chips at the bottom of the popover repeat the right-click menu items so you can stay on the hover surface for one-handed drill. Hover preview makes one HTTP call per component (not per cell) and caches the result for the session — an N-row grid is at most N round trips, only for rows you actually hover.


Cell Actions

Right-click any cell to get the full action menu. The same actions are surfaced as chips on the hover popover.

Action When shown Effect
Quick View drillable cell Renders the cell's stream as a full Highcharts chart in the south Quick View panel. Keeps your grid in view.
Open Stream drillable cell Opens the cell's stream as a stream editor tab — the same view you get from the Components tree.
Set Value writable cell Writes back to the underlying stream. See below.
Diagnose derived stream Opens a Derivation Diagnostics window: expression, dependents (with cycle and stat), and one-click drill into each dependent or the derived stream itself.
Follow FK foreign-key cell Opens a new GetData tab on the FK target template, filtered to the referenced component's UID. Walks across the entity graph one hop at a time.
Show in Tree any cell Selects the cell's component in the Components tree and scrolls the tree to it. Useful when a query returns components from folders you don't have memorized.

Set Value — Writing Back

Set Value writes back to the underlying temporal stream from any writable cell. It's the same Temporal Wire ingestion path the REST API uses — same RBAC, same audit trail, same downstream derivation and rollup recalculation.

The dialog defaults to replace semantics:

  • Sample Time defaults to the cell's existing sample timestamp (stream.feed.lastUpdated). Saving with this timestamp overwrites the existing sample. The grid cell, every dependent derivation, and every rollup that touched that timestamp recalculate.
  • Now button replaces the Sample Time with the current clock. Saving with "Now" inserts a brand-new sample at the current time — appending, not replacing.

The distinction matters: a cell value you're correcting is a replace (keep the timestamp, fix the value); a cell value you're continuing is an append. The dialog default is replace because that's the action most likely to follow "I noticed this cell is wrong."

Writable cells are determined by the origin.writable flag set server-side. Direct stream cells are writable; derived stream cells, foreign-key cells, and aggregated/rollup result columns are not. Read-only columns simply don't surface the Set Value action.

Permissions are enforced at the query layer. If a user lacks write rights on the stream, Set Value returns a permission error — the same error any other write path would return.


Derivation Diagnostics

Right-click a derived stream cell → Diagnose. A non-modal window opens with the derivation expression, each variable's mapped source stream (with cycle/stat if interval-aware), the count of external (cross-component) references, and the last-executed timestamp.

Dependent stream names are links: clicking one opens that dependent's instance stream as a stream tab. Two buttons at the bottom of the window act on the derived stream itself:

  • Derived Stream Diagnostics — opens the full per-cycle diagnostics viewer (the same window the stream editor's Diagnose ribbon button opens) for the derived stream.
  • Drill Into Derived Stream — opens an interactive drill panel against the derived stream's history. Click forward through dependents to see how each value was computed at each interval.

This is the same diagnostics infrastructure used by the stream editor — GetData just lets you reach it from the cell you noticed was wrong, instead of navigating to the stream first.


Follow FK

Foreign-key cells hold a target component's UID. Follow FK opens a new GetData tab on the FK target's template, with a WHERE _component_uid = '<target>' filter already applied and executed. One click walks one hop across the entity graph.

Chain it: from meter's customer_uid cell, Follow FK to customer; from customer's supplier_uid cell, Follow FK to supplier. Each hop is a new tab, so you can compare across the chain without losing the origin grid.


AI Assistant Context

Click a cell to select it. Selected cells appear as context chips in the AI Assistant panel along with any selected components, streams, dashboards, or queries. Ask a question — the assistant gets the cell's component UID, stream ID, value, timestamp, and source template without you having to repeat any of that in the prompt.

Each chip has an × button to remove it from context, so you can pare down to exactly the cells you want the assistant to reason over.


Permissions

GetData inherits every layer of GroveStreams security:

  • Read. The result set is filtered by the query engine on behalf of the current user. Rows the user can't see don't appear — they're absent from the result, not hidden in the UI.
  • Drill. Opening a stream, following an FK, or selecting in the tree all route through the standard editor paths and re-check rights.
  • Write. Set Value goes through the standard Temporal Wire path. Write denied at the stream level fails the cell write with the same error any other path would return.
  • Audit. Writes from GetData appear in the audit log as ingested samples from the user's session — indistinguishable from any other ingestion source for compliance review.