Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

api.log_view

Description

Log web view

Table Definition
CREATE VIEW log_view AS (
 SELECT id,
    name,
    _from AS "from",
    _from_time AS started,
    _to AS "to",
    _to_time AS ended,
    distance,
    duration,
    notes,
    api.export_logbook_geojson_trip_fn(id) AS geojson,
    avg_speed,
    max_speed,
    max_wind_speed,
    extra,
    _from_moorage_id AS from_moorage_id,
    _to_moorage_id AS to_moorage_id,
    (extra -> 'polar'::text) AS polar,
    (user_data -> 'images'::text) AS images,
    (user_data -> 'tags'::text) AS tags,
    (user_data -> 'observations'::text) AS observations,
        CASE
            WHEN (jsonb_array_length((user_data -> 'images'::text)) > 0) THEN true
            ELSE false
        END AS has_images
   FROM api.logbook l
  WHERE ((_to_time IS NOT NULL) AND (trip IS NOT NULL))
  ORDER BY _from_time DESC
)

Columns

NameTypeDefaultNullable
avg_speeddouble precisiontrue
distancenumerictrue
durationintervaltrue
endedtimestamp with time zonetrue
extrajsonbtrue
fromtexttrue
from_moorage_idintegertrue
geojsonjsonbtrue
has_imagesbooleantrue
idintegertrue
imagesjsonbtrue
max_speeddouble precisiontrue
max_wind_speeddouble precisiontrue
nametexttrue
notestexttrue
observationsjsonbtrue
polarjsonbtrue
startedtimestamp with time zonetrue
tagsjsonbtrue
totexttrue
to_moorage_idintegertrue

Referenced Tables

NameColumnsCommentType
api.logbook42Stores generated logbookBASE TABLE

Relations

erDiagram


"api.log_view" {
  double_precision avg_speed ""
  numeric distance ""
  interval duration ""
  timestamp_with_time_zone ended ""
  jsonb extra ""
  text from ""
  integer from_moorage_id ""
  jsonb geojson ""
  boolean has_images ""
  integer id ""
  jsonb images ""
  double_precision max_speed ""
  double_precision max_wind_speed ""
  text name ""
  text notes ""
  jsonb observations ""
  jsonb polar ""
  timestamp_with_time_zone started ""
  jsonb tags ""
  text to ""
  integer to_moorage_id ""
}

Generated by tbls