46 lines
730 B
Go
46 lines
730 B
Go
// outlooks_queries.go contains SQL text for outlook reads.
|
|
// Layer: adapters/outbound/postgres outlook feature.
|
|
package postgres
|
|
|
|
const (
|
|
queryLatestConvectiveOutlookRun = `
|
|
SELECT
|
|
event_id,
|
|
location_id,
|
|
location_name,
|
|
latitude,
|
|
longitude,
|
|
as_of,
|
|
issued_at
|
|
FROM outlook_runs
|
|
ORDER BY as_of DESC, event_emitted_at DESC
|
|
LIMIT 1`
|
|
|
|
queryOutlooksForRun = `
|
|
SELECT
|
|
outlook_index,
|
|
outlook_id,
|
|
provider,
|
|
product,
|
|
day,
|
|
outlook_type,
|
|
label,
|
|
label_text,
|
|
severity_rank,
|
|
valid_from,
|
|
valid_to,
|
|
issued_at,
|
|
expires_at,
|
|
forecaster,
|
|
headline,
|
|
summary,
|
|
discussion,
|
|
source_url,
|
|
image_url,
|
|
contains_location,
|
|
geometry_json
|
|
FROM outlooks
|
|
WHERE run_event_id = $1
|
|
ORDER BY outlook_index ASC`
|
|
)
|