Ability to set custom table/view page size in metadata, closes #751

This commit is contained in:
Simon Willison 2020-05-27 22:00:04 -07:00
commit 75cd432e5a
4 changed files with 27 additions and 3 deletions

View file

@ -156,6 +156,29 @@ Or use ``"sort_desc"`` to sort in descending order:
}
}
.. _metadata_page_size:
Setting a custom page size
--------------------------
Datasette defaults to displaing 100 rows per page, for both tables and views. You can change this default page size on a per-table or per-view basis using the ``"size"`` key in ``metadata.json``:
.. code-block:: json
{
"databases": {
"mydatabase": {
"tables": {
"example_table": {
"size": 10
}
}
}
}
}
This size can still be over-ridden by passing e.g. ``?_size=50`` in the querystring.
.. _metadata_sortable_columns:
Setting which columns can be used for sorting