Skip to content

Commit b6a8d19

Browse files
committed
Stats endpoint: export last update timestamp
1 parent 0100faa commit b6a8d19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/crud.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def get_schools(db: Session, skip: int = 0, limit: int = 100, filter_params=None
2727

2828

2929
def get_stats(db: Session):
30-
response = db.execute(text("""select substring(id, 1, 2) as state, count(*) as count
30+
response = db.execute(text("""select
31+
substring(id, 1, 2) as state,
32+
count(*) as count,
33+
max(update_timestamp)::date as last_updated
3134
from schools
3235
group by state
3336
order by state;"""))

0 commit comments

Comments
 (0)