Add convective outlook Postgres read adapter
This commit is contained in:
45
internal/adapters/outbound/postgres/outlooks_queries.go
Normal file
45
internal/adapters/outbound/postgres/outlooks_queries.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// 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`
|
||||
)
|
||||
Reference in New Issue
Block a user