MCPcopy Create free account
hub / github.com/actix/examples / get_hottest_months

Function get_hottest_months

databases/sqlite/src/db.rs:86–98  ·  view source on GitHub ↗
(conn: Connection)

Source from the content-addressed store, hash-verified

84}
85
86fn get_hottest_months(conn: Connection) -> WeatherAggResult {
87 let stmt = conn.prepare(
88 "SELECT cast(strftime('%Y', date) as int) as theyear,
89 cast(strftime('%m', date) as int) as themonth,
90 sum(tmax) as total
91 FROM nyc_weather
92 WHERE tmax <> 'TMAX'
93 GROUP BY theyear, themonth
94 ORDER BY total DESC LIMIT 10",
95 )?;
96
97 get_rows_as_month_agg(stmt)
98}
99
100fn get_coldest_months(conn: Connection) -> WeatherAggResult {
101 let stmt = conn.prepare(

Callers 1

executeFunction · 0.85

Calls 1

get_rows_as_month_aggFunction · 0.85

Tested by

no test coverage detected