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:
33
internal/adapters/outbound/postgres/observations_queries.go
Normal file
33
internal/adapters/outbound/postgres/observations_queries.go
Normal file
@@ -0,0 +1,33 @@
|
||||
// observations_queries.go contains SQL text for observation reads.
|
||||
// Layer: adapters/outbound/postgres observations feature.
|
||||
package postgres
|
||||
|
||||
const (
|
||||
queryLatestObservation = `
|
||||
SELECT
|
||||
event_id,
|
||||
station_id,
|
||||
station_name,
|
||||
observed_at,
|
||||
condition_code,
|
||||
is_day,
|
||||
text_description,
|
||||
temperature_c,
|
||||
dewpoint_c,
|
||||
wind_direction_degrees,
|
||||
wind_speed_kmh,
|
||||
wind_gust_kmh,
|
||||
barometric_pressure_pa,
|
||||
visibility_meters,
|
||||
relative_humidity_percent,
|
||||
apparent_temperature_c
|
||||
FROM observations
|
||||
ORDER BY observed_at DESC, event_emitted_at DESC
|
||||
LIMIT 1`
|
||||
|
||||
queryObservationPresentWeather = `
|
||||
SELECT weather_index, raw_text
|
||||
FROM observation_present_weather
|
||||
WHERE event_id = $1
|
||||
ORDER BY weather_index ASC`
|
||||
)
|
||||
Reference in New Issue
Block a user