mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Ability to set custom table/view page size in metadata, closes #751
This commit is contained in:
parent
510c1989d4
commit
75cd432e5a
4 changed files with 27 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue