api.metrics_explore_view
Description
Expands all SignalK keys from the vessel’s latest metric row.
Used to discover available paths for custom configuration mapping.
Table Definition
CREATE VIEW metrics_explore_view AS (
WITH raw_metrics AS (
SELECT metrics."time",
metrics.metrics
FROM api.metrics
WHERE (metrics.vessel_id = current_setting('vessel.id'::text, true))
ORDER BY metrics."time" DESC
LIMIT 1
)
SELECT raw_metrics."time",
kv.key,
kv.value
FROM raw_metrics,
LATERAL jsonb_each_text(raw_metrics.metrics) kv(key, value)
ORDER BY kv.key
)
Columns
| Name | Type | Default | Nullable |
|---|---|---|---|
| key | text | true | |
| time | timestamp with time zone | true | |
| value | text | true |
Referenced Tables
| Name | Columns | Comment | Type |
|---|---|---|---|
| api.metrics | 11 | Stores time-series metrics from vessel via SignalK plugin. TimescaleDB hypertable partitioned by time. | BASE TABLE |
Relations
erDiagram
"api.metrics_explore_view" {
text key ""
timestamp_with_time_zone time ""
text value ""
}
Generated by tbls