mirror of
https://github.com/simonw/datasette.git
synced 2026-05-31 14:16:59 +02:00
* Add keyset pagination to allowed_resources() This replaces the unbounded list return with PaginatedResources, which supports efficient keyset pagination for handling thousands of resources. Closes #2560 Changes: - allowed_resources() now returns PaginatedResources instead of list - Added limit (1-1000, default 100) and next (keyset token) parameters - Added include_reasons parameter (replaces allowed_resources_with_reasons) - Removed allowed_resources_with_reasons() method entirely - PaginatedResources.all() async generator for automatic pagination - Uses tilde-encoding for tokens (matching table pagination) - Updated all callers to use .resources accessor - Updated documentation with new API and examples The PaginatedResources object has: - resources: List of Resource objects for current page - next: Token for next page (None if no more results) - all(): Async generator that yields all resources across pages Example usage: page = await ds.allowed_resources("view-table", actor, limit=100) for table in page.resources: print(table.child) # Iterate all pages automatically async for table in page.all(): print(table.child) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| publish | ||
| static | ||
| templates | ||
| utils | ||
| views | ||
| __init__.py | ||
| __main__.py | ||
| actor_auth_cookie.py | ||
| app.py | ||
| blob_renderer.py | ||
| cli.py | ||
| database.py | ||
| default_actions.py | ||
| default_magic_parameters.py | ||
| default_menu_links.py | ||
| default_permissions.py | ||
| events.py | ||
| facets.py | ||
| filters.py | ||
| forbidden.py | ||
| handle_exception.py | ||
| hookspecs.py | ||
| inspect.py | ||
| permissions.py | ||
| plugins.py | ||
| renderer.py | ||
| resources.py | ||
| sql_functions.py | ||
| tracer.py | ||
| url_builder.py | ||
| version.py | ||