api.total_info_view
Description
total_info_view web view
Table Definition
CREATE VIEW total_info_view AS (
WITH l AS (
SELECT count(*) AS logs
FROM api.logbook
), s AS (
SELECT count(*) AS stays
FROM api.stays
), m AS (
SELECT count(*) AS moorages
FROM api.moorages
)
SELECT l.logs,
s.stays,
m.moorages
FROM l,
s,
m
)
Columns
| Name | Type | Default | Nullable |
|---|---|---|---|
| logs | bigint | true | |
| moorages | bigint | true | |
| stays | bigint | true |
Referenced Tables
| Name | Columns | Comment | Type |
|---|---|---|---|
| api.logbook | 43 | The logbook table stores vessel navigation entries with timestamps, locations, and trip metrics. RLS policies filter by vessel_id automatically. These indexes optimize different query patterns while minimizing storage. | BASE TABLE |
| api.stays | 15 | The stays table records time spent at moorages. Each stay links a moorage with arrival/departure timestamps. RLS policies filter by vessel_id. | BASE TABLE |
| api.moorages | 14 | The moorages table stores locations where vessels can stay (marinas, anchorages, etc.). Each moorage has geographic coordinates and metadata. | BASE TABLE |
Relations
erDiagram
"api.total_info_view" {
bigint logs ""
bigint moorages ""
bigint stays ""
}
Generated by tbls