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

Function get_hottest_years

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

Source from the content-addressed store, hash-verified

45}
46
47fn get_hottest_years(conn: Connection) -> WeatherAggResult {
48 let stmt = conn.prepare(
49 "
50 SELECT cast(strftime('%Y', date) as int) as theyear,
51 sum(tmax) as total
52 FROM nyc_weather
53 WHERE tmax <> 'TMAX'
54 GROUP BY theyear
55 ORDER BY total DESC LIMIT 10",
56 )?;
57
58 get_rows_as_annual_agg(stmt)
59}
60
61fn get_coldest_years(conn: Connection) -> WeatherAggResult {
62 let stmt = conn.prepare(

Callers 1

executeFunction · 0.85

Calls 1

get_rows_as_annual_aggFunction · 0.85

Tested by

no test coverage detected