mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Entirely removed table_rows_count table property
We were not displaying this anywhere, and it is now expensive to calculate. Refs #419, #420
This commit is contained in:
parent
3651eedf20
commit
efc93b8ab5
4 changed files with 0 additions and 10 deletions
|
|
@ -84,7 +84,6 @@ http://localhost:8001/History/downloads.json will return that data as JSON:
|
|||
"total_bytes",
|
||||
...
|
||||
],
|
||||
"table_rows_count": 576,
|
||||
"rows": [
|
||||
[
|
||||
1,
|
||||
|
|
|
|||
|
|
@ -317,12 +317,7 @@ class TableView(RowTableShared):
|
|||
)
|
||||
params["search_{}".format(i)] = search_text
|
||||
|
||||
table_rows_count = None
|
||||
sortable_columns = set()
|
||||
if not is_view:
|
||||
table_rows_count = (await self.ds.execute(
|
||||
database, "select count(*) from {}".format(escape_sqlite(table))
|
||||
)).rows[0][0]
|
||||
|
||||
sortable_columns = await self.sortable_columns_for_table(database, table, use_rowid)
|
||||
|
||||
|
|
@ -760,7 +755,6 @@ class TableView(RowTableShared):
|
|||
"human_description_en": human_description_en,
|
||||
"rows": rows[:page_size],
|
||||
"truncated": results.truncated,
|
||||
"table_rows_count": table_rows_count,
|
||||
"filtered_table_rows_count": filtered_table_rows_count,
|
||||
"expanded_columns": expanded_columns,
|
||||
"expandable_columns": expandable_columns,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ JSON:
|
|||
"total_bytes",
|
||||
...
|
||||
],
|
||||
"table_rows_count": 576,
|
||||
"rows": [
|
||||
[
|
||||
1,
|
||||
|
|
|
|||
|
|
@ -700,7 +700,6 @@ def test_page_size_zero(app_client):
|
|||
response = app_client.get('/fixtures/no_primary_key.json?_size=0')
|
||||
assert 200 == response.status
|
||||
assert [] == response.json['rows']
|
||||
assert 201 == response.json['table_rows_count']
|
||||
assert 201 == response.json['filtered_table_rows_count']
|
||||
assert None is response.json['next']
|
||||
assert None is response.json['next_url']
|
||||
|
|
@ -800,7 +799,6 @@ def test_sortable_and_filtered(app_client):
|
|||
if 'd' in row['content']
|
||||
]
|
||||
assert len(expected) == response.json['filtered_table_rows_count']
|
||||
assert 201 == response.json['table_rows_count']
|
||||
expected.sort(key=lambda row: -row['sortable'])
|
||||
assert [
|
||||
r['content'] for r in expected
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue