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

Function get_coldest_months

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

Source from the content-addressed store, hash-verified

98}
99
100fn get_coldest_months(conn: Connection) -> WeatherAggResult {
101 let stmt = conn.prepare(
102 "SELECT cast(strftime('%Y', date) as int) as theyear,
103 cast(strftime('%m', date) as int) as themonth,
104 sum(tmax) as total
105 FROM nyc_weather
106 WHERE tmax <> 'TMAX'
107 GROUP BY theyear, themonth
108 ORDER BY total ASC LIMIT 10",
109 )?;
110
111 get_rows_as_month_agg(stmt)
112}
113
114fn get_rows_as_month_agg(mut statement: Statement) -> WeatherAggResult {
115 statement

Callers 1

executeFunction · 0.85

Calls 1

get_rows_as_month_aggFunction · 0.85

Tested by

no test coverage detected