Refactored the application structure to better separate concerns between files and packages
Some checks failed
ci/woodpecker/push/build-image Pipeline failed
Some checks failed
ci/woodpecker/push/build-image Pipeline failed
This commit is contained in:
53
internal/adapters/outbound/postgres/alerts_queries.go
Normal file
53
internal/adapters/outbound/postgres/alerts_queries.go
Normal file
@@ -0,0 +1,53 @@
|
||||
// alerts_queries.go contains SQL text for alert-run reads.
|
||||
// Layer: adapters/outbound/postgres alerts feature.
|
||||
package postgres
|
||||
|
||||
const (
|
||||
queryLatestAlertRun = `
|
||||
SELECT
|
||||
event_id,
|
||||
location_id,
|
||||
location_name,
|
||||
as_of,
|
||||
latitude,
|
||||
longitude
|
||||
FROM alert_runs
|
||||
ORDER BY as_of DESC, event_emitted_at DESC
|
||||
LIMIT 1`
|
||||
|
||||
queryAlerts = `
|
||||
SELECT
|
||||
alert_index,
|
||||
alert_id,
|
||||
event,
|
||||
headline,
|
||||
severity,
|
||||
urgency,
|
||||
certainty,
|
||||
status,
|
||||
message_type,
|
||||
category,
|
||||
response,
|
||||
description,
|
||||
instruction,
|
||||
sent,
|
||||
effective,
|
||||
onset,
|
||||
expires,
|
||||
area_description,
|
||||
sender_name
|
||||
FROM alerts
|
||||
WHERE run_event_id = $1
|
||||
ORDER BY alert_index ASC`
|
||||
|
||||
queryAlertReferences = `
|
||||
SELECT
|
||||
alert_index,
|
||||
id,
|
||||
identifier,
|
||||
sender,
|
||||
sent
|
||||
FROM alert_references
|
||||
WHERE run_event_id = $1
|
||||
ORDER BY alert_index ASC, reference_index ASC`
|
||||
)
|
||||
Reference in New Issue
Block a user