mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Show total number of rows in table
This commit is contained in:
parent
1ae8ea0f03
commit
eef213ab4d
2 changed files with 4 additions and 1 deletions
3
app.py
3
app.py
|
|
@ -195,10 +195,13 @@ class TableView(BaseView):
|
|||
columns = [r[0] for r in rows.description]
|
||||
pks = pks_for_table(conn, table)
|
||||
rows = list(rows)
|
||||
info = ensure_build_metadata()
|
||||
total_rows = info[name]['tables'][table]
|
||||
return {
|
||||
'database': name,
|
||||
'table': table,
|
||||
'rows': rows,
|
||||
'total_rows': total_rows,
|
||||
'columns': columns,
|
||||
'primary_keys': pks,
|
||||
}, lambda: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue