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

Function get_coldest_years

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

Source from the content-addressed store, hash-verified

59}
60
61fn get_coldest_years(conn: Connection) -> WeatherAggResult {
62 let stmt = conn.prepare(
63 "
64 SELECT cast(strftime('%Y', date) as int) as theyear,
65 sum(tmax) as total
66 FROM nyc_weather
67 WHERE tmax <> 'TMAX'
68 GROUP BY theyear
69 ORDER BY total ASC LIMIT 10",
70 )?;
71
72 get_rows_as_annual_agg(stmt)
73}
74
75fn get_rows_as_annual_agg(mut statement: Statement) -> WeatherAggResult {
76 statement

Callers 1

executeFunction · 0.85

Calls 1

get_rows_as_annual_aggFunction · 0.85

Tested by

no test coverage detected