sections
4 rows where references = "[]" and title = "The "
This data as json, CSV (advanced)
Suggested facets: page, breadcrumbs, breadcrumbs (array)
| id ▼ | page | ref | title | content | breadcrumbs | references |
|---|---|---|---|---|---|---|
| plugin_hooks:plugin-resources-sql | plugin_hooks | plugin-resources-sql | The | The resources_sql() classmethod returns a SQL query that lists all resources of that type that exist in the system. It can be async because Datasette calls it with await , and it receives the current datasette instance plus an optional actor argument. This query is used by Datasette to efficiently check permissions across multiple resources at once. When a user requests a list of resources (like tables, documents, or other entities), Datasette uses this SQL to: Get all resources of this type from your data catalog Combine it with permission rules from the permission_resources_sql hook Use SQL joins and filtering to determine which resources the actor can access Return only the permitted resources The SQL query must return exactly two columns: parent - The parent identifier (e.g., database name, collection name), or NULL for top-level resources child - The child identifier (e.g., table name, document ID), or NULL for parent-only resources For example, if you're building a document management plugin with collections and documents stored in a documents table, your resources_sql() might look like: @classmethod async def resources_sql(cls, datasette, actor=None) -> str: return """ SELECT collection_name AS parent, document_id AS child FROM documents """ This tells Datasette "here's how to find all documents in the system - look in the documents table and get the collection name and document ID for each … | ["Plugin hooks", "register_actions(datasette)"] | [] |
| upgrade_guide:upgrade-guide-v1-metadata-json-removed | upgrade_guide | upgrade-guide-v1-metadata-json-removed | The | As of Datasette 1.0a14 , the root level /metadata.json endpoint has been removed. Metadata for tables will become available through currently in-development extras in a future alpha. | ["Upgrade guide", "Datasette 0.X -> 1.0", "Metadata changes"] | [] |
| upgrade_guide:upgrade-guide-v1-metadata-method-removed | upgrade_guide | upgrade-guide-v1-metadata-method-removed | The | As of Datasette 1.0a14 , the .metadata() method on the Datasette Python API has been removed. Instead, one should use the following methods on a Datasette class: get_instance_metadata() get_database_metadata() get_resource_metadata() get_column_metadata() | ["Upgrade guide", "Datasette 0.X -> 1.0", "Metadata changes"] | [] |
| upgrade_guide:upgrade-guide-v1-metadata-removed | upgrade_guide | upgrade-guide-v1-metadata-removed | The | In Datasette 0.x plugins could implement a get_metadata() plugin hook to customize how metadata was retrieved for different instances, databases and tables. This hook could be inefficient, since some pages might load metadata for many different items (to list a large number of tables, for example) which could result in a large number of calls to potentially expensive plugin hook implementations. As of Datasette 1.0a14 (2024-08-05), the get_metadata() hook has been deprecated: # ❌ DEPRECATED in Datasette 1.0 @hookimpl def get_metadata(datasette, key, database, table): pass Instead, plugins are encouraged to interact directly with Datasette's in-memory metadata tables in SQLite using the following methods on the Datasette class : get_instance_metadata() and set_instance_metadata() get_database_metadata() and set_database_metadata() get_resource_metadata() and set_resource_metadata() get_column_metadata() and set_column_metadata() A plugin that stores or calculates its own metadata can implement the startup(datasette) hook to populate those items on startup, and then call those methods while it is running to persist any new metadata changes. | ["Upgrade guide", "Datasette 0.X -> 1.0", "Metadata changes"] | [] |
Advanced export
JSON shape: default, array, newline-delimited, object
CREATE TABLE [sections] ( [id] TEXT PRIMARY KEY, [page] TEXT, [ref] TEXT, [title] TEXT, [content] TEXT, [breadcrumbs] TEXT, [references] TEXT );