home / docs / sections

sections

613 rows sorted by page

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: breadcrumbs (array)

page >30 ✖

  • changelog 199
  • internals 66
  • plugin_hooks 45
  • authentication 38
  • settings 29
  • json_api 19
  • contributing 17
  • cli-reference 15
  • installation 13
  • metadata 13
  • sql_queries 13
  • custom_templates 12
  • writing_plugins 11
  • full_text_search 10
  • introspection 10
  • spatialite 10
  • upgrade_guide 10
  • configuration 8
  • deploying 8
  • plugins 8
  • publish 8
  • facets 7
  • javascript_plugins 7
  • pages 7
  • testing_plugins 7
  • getting_started 6
  • performance 5
  • binary_data 3
  • csv_export 3
  • ecosystem 3
  • …
id page ▼ ref title content breadcrumbs references
authentication:authentication authentication authentication Authentication and permissions Datasette doesn't require authentication by default. Any visitor to a Datasette instance can explore the full data and execute read-only SQL queries. Datasette's plugin system can be used to add many different styles of authentication, such as user accounts, single sign-on or API keys. [] []
authentication:authentication-actor authentication authentication-actor Actors Through plugins, Datasette can support both authenticated users (with cookies) and authenticated API agents (via authentication tokens). The word "actor" is used to cover both of these cases. Every request to Datasette has an associated actor value, available in the code as request.actor . This can be None for unauthenticated requests, or a JSON compatible Python dictionary for authenticated users or API agents. The actor dictionary can be any shape - the design of that data structure is left up to the plugins. A useful convention is to include an "id" string, as demonstrated by the "root" actor below. Plugins can use the actor_from_request(datasette, request) hook to implement custom logic for authenticating an actor based on the incoming HTTP request. ["Authentication and permissions"] []
authentication:authentication-root authentication authentication-root Using the "root" actor Datasette currently leaves almost all forms of authentication to plugins - datasette-auth-github for example. The one exception is the "root" account, which you can sign into while using Datasette on your local machine. This provides access to a small number of debugging features. To sign in as root, start Datasette using the --root command-line option, like this: datasette --root http://127.0.0.1:8001/-/auth-token?token=786fc524e0199d70dc9a581d851f466244e114ca92f33aa3b42a139e9388daa7 INFO: Started server process [25801] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8001 (Press CTRL+C to quit) The URL on the first line includes a one-use token which can be used to sign in as the "root" actor in your browser. Click on that link and then visit http://127.0.0.1:8001/-/actor to confirm that you are authenticated as an actor that looks like this: { "id": "root" } ["Authentication and permissions", "Actors"] [{"href": "https://github.com/simonw/datasette-auth-github", "label": "datasette-auth-github"}]
authentication:authentication-permissions authentication authentication-permissions Permissions Datasette has an extensive permissions system built-in, which can be further extended and customized by plugins. The key question the permissions system answers is this: Is this actor allowed to perform this action , optionally against this particular resource ? Actors are described above . An action is a string describing the action the actor would like to perform. A full list is provided below - examples include view-table and execute-sql . A resource is the item the actor wishes to interact with - for example a specific database or table. Some actions, such as permissions-debug , are not associated with a particular resource. Datasette's built-in view permissions ( view-database , view-table etc) default to allow - unless you configure additional permission rules unauthenticated users will be allowed to access content. Permissions with potentially harmful effects should default to deny . Plugin authors should account for this when designing new plugins - for example, the datasette-upload-csvs plugin defaults to deny so that installations don't accidentally allow unauthenticated users to create new tables by uploading a CSV file. ["Authentication and permissions"] [{"href": "https://github.com/simonw/datasette-upload-csvs", "label": "datasette-upload-csvs"}]
authentication:authentication-permissions-explained authentication authentication-permissions-explained How permissions are resolved The datasette.permission_allowed(actor, action, resource=None, default=...) method is called to check if an actor is allowed to perform a specific action. This method asks every plugin that implements the permission_allowed(datasette, actor, action, resource) hook if the actor is allowed to perform the action. Each plugin can return True to indicate that the actor is allowed to perform the action, False if they are not allowed and None if the plugin has no opinion on the matter. False acts as a veto - if any plugin returns False then the permission check is denied. Otherwise, if any plugin returns True then the permission check is allowed. The resource argument can be used to specify a specific resource that the action is being performed against. Some permissions, such as view-instance , do not involve a resource. Others such as view-database have a resource that is a string naming the database. Permissions that take both a database name and the name of a table, view or canned query within that database use a resource that is a tuple of two strings, (database_name, resource_name) . Plugins that implement the permission_allowed() hook can decide if they are going to consider the provided resource or not. ["Authentication and permissions", "Permissions"] []
authentication:authentication-permissions-allow authentication authentication-permissions-allow Defining permissions with "allow" blocks The standard way to define permissions in Datasette is to use an "allow" block in the datasette.yaml file . This is a JSON document describing which actors are allowed to perform a permission. The most basic form of allow block is this ( allow demo , deny demo ): [[[cog from metadata_doc import config_example import textwrap config_example(cog, textwrap.dedent( """ allow: id: root """).strip(), "YAML", "JSON" ) ]]] [[[end]]] This will match any actors with an "id" property of "root" - for example, an actor that looks like this: { "id": "root", "name": "Root User" } An allow block can specify "deny all" using false ( demo ): [[[cog from metadata_doc import config_example import textwrap config_example(cog, textwrap.dedent( """ allow: false """).strip(), "YAML", "JSON" ) ]]] [[[end]]] An "allow" of true allows all access ( demo ): [[[cog from metadata_doc import config_example import textwrap config_example(cog, textwrap.dedent( """ allow: true """).strip(), "YAML", "JSON" ) ]]] [[[end]]] Allow keys can provide a list of values. These will match any actor that has any of those values ( allow demo , deny demo ): [[[cog from metadata_doc import config_example import textwrap config_example(cog, textwrap.dedent( """ allow: id: - simon - cleopaws """).strip(), "YAML", "JSON" ) ]]] [[[end]]] This will match any actor with an "id" of either "simon" or "cleopaws" . Actors can have properties that feature a list of values. These will be matched against the list of values in an allow block. Consider the following actor: { "id": "simon"… ["Authentication and permissions", "Permissions"] [{"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%22id%22%3A+%22root%22%7D&allow=%7B%0D%0A++++++++%22id%22%3A+%22root%22%0D%0A++++%7D", "label": "allow demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%22id%22%3A+%22trevor%22%7D&allow=%7B%0D%0A++++++++%22id%22%3A+%22root%22%0D%0A++++%7D", "label": "deny demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22root%22%0D%0A%7D&allow=false", "label": "demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22root%22%0D%0A%7D&allow=true", "label": "demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22cleopaws%22%0D%0A%7D&allow=%7B%0D%0A++++%22id%22%3A+%5B%0D%0A++++++++%22simon%22%2C%0D%0A++++++++%22cleopaws%22%0D%0A++++%5D%0D%0A%7D", "label": "allow demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22pancakes%22%0D%0A%7D&allow=%7B%0D%0A++++%22id%22%3A+%5B%0D%0A++++++++%22simon%22%2C%0D%0A++++++++%22cleopaws%22%0D%0A++++%5D%0D%0A%7D", "label": "deny demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22simon%22%2C%0D%0A++++%22roles%22%3A+%5B%0D%0A++++++++%22staff%22%2C%0D%0A++++++++%22developer%22%0D%0A++++%5D%0D%0A%7D&allow=%7B%0D%0A++++%22roles%22%3A+%5B%0D%0A++++++++%22developer%22%0D%0A++++%5D%0D%0A%7D", "label": "allow demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22cleopaws%22%2C%0D%0A++++%22roles%22%3A+%5B%22dog%22%5D%0D%0A%7D&allow=%7B%0D%0A++++%22roles%22%3A+%5B%0D%0A++++++++%22developer%22%0D%0A++++%5D%0D%0A%7D", "label": "deny demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22id%22%3A+%22simon%22%0D%0A%7D&allow=%7B%0D%0A++++%22id%22%3A+%22*%22%0D%0A%7D", "label": "allow demo"}, {"href": "https://latest.datasette.io/-/allow-debug?actor=%7B%0D%0A++++%22bot%22%3A+%22readme-bot%22%0D%0A%7D&allow=%7B%0D%0A++++%22id%22%3A+%22*%22%0D%0A%7D", "label": "deny demo"…
authentication:allowdebugview authentication allowdebugview The /-/allow-debug tool The /-/allow-debug tool lets you try out different "action" blocks against different "actor" JSON objects. You can try that out here: https://latest.datasette.io/-/allow-debug ["Authentication and permissions", "Permissions"] [{"href": "https://latest.datasette.io/-/allow-debug", "label": "https://latest.datasette.io/-/allow-debug"}]
authentication:authentication-permissions-config authentication authentication-permissions-config Access permissions in There are two ways to configure permissions using datasette.yaml (or datasette.json ). For simple visibility permissions you can use "allow" blocks in the root, database, table and query sections. For other permissions you can use a "permissions" block, described in the next section . You can limit who is allowed to view different parts of your Datasette instance using "allow" keys in your Configuration . You can control the following: Access to the entire Datasette instance Access to specific databases Access to specific tables and views Access to specific Canned queries If a user cannot access a specific database, they will not be able to access tables, views or queries within that database. If a user cannot access the instance they will not be able to access any of the databases, tables, views or queries. ["Authentication and permissions"] []
authentication:authentication-permissions-instance authentication authentication-permissions-instance Access to an instance Here's how to restrict access to your entire Datasette instance to just the "id": "root" user: [[[cog from metadata_doc import config_example config_example(cog, """ title: My private Datasette instance allow: id: root """) ]]] [[[end]]] To deny access to all users, you can use "allow": false : [[[cog config_example(cog, """ title: My entirely inaccessible instance allow: false """) ]]] [[[end]]] One reason to do this is if you are using a Datasette plugin - such as datasette-permissions-sql - to control permissions instead. ["Authentication and permissions", "Access permissions in "] [{"href": "https://github.com/simonw/datasette-permissions-sql", "label": "datasette-permissions-sql"}]
authentication:authentication-permissions-database authentication authentication-permissions-database Access to specific databases To limit access to a specific private.db database to just authenticated users, use the "allow" block like this: [[[cog config_example(cog, """ databases: private: allow: id: "*" """) ]]] [[[end]]] ["Authentication and permissions", "Access permissions in "] []
authentication:authentication-permissions-table authentication authentication-permissions-table Access to specific tables and views To limit access to the users table in your bakery.db database: [[[cog config_example(cog, """ databases: bakery: tables: users: allow: id: '*' """) ]]] [[[end]]] This works for SQL views as well - you can list their names in the "tables" block above in the same way as regular tables. Restricting access to tables and views in this way will NOT prevent users from querying them using arbitrary SQL queries, like this for example. If you are restricting access to specific tables you should also use the "allow_sql" block to prevent users from bypassing the limit with their own SQL queries - see Controlling the ability to execute arbitrary SQL . ["Authentication and permissions", "Access permissions in "] [{"href": "https://latest.datasette.io/fixtures?sql=select+*+from+facetable", "label": "like this"}]
authentication:authentication-permissions-query authentication authentication-permissions-query Access to specific canned queries Canned queries allow you to configure named SQL queries in your datasette.yaml that can be executed by users. These queries can be set up to both read and write to the database, so controlling who can execute them can be important. To limit access to the add_name canned query in your dogs.db database to just the root user : [[[cog config_example(cog, """ databases: dogs: queries: add_name: sql: INSERT INTO names (name) VALUES (:name) write: true allow: id: - root """) ]]] [[[end]]] ["Authentication and permissions", "Access permissions in "] []
authentication:authentication-permissions-execute-sql authentication authentication-permissions-execute-sql Controlling the ability to execute arbitrary SQL Datasette defaults to allowing any site visitor to execute their own custom SQL queries, for example using the form on the database page or by appending a ?_where= parameter to the table page like this . Access to this ability is controlled by the execute-sql permission. The easiest way to disable arbitrary SQL queries is using the default_allow_sql setting when you first start Datasette running. You can alternatively use an "allow_sql" block to control who is allowed to execute arbitrary SQL queries. To prevent any user from executing arbitrary SQL queries, use this: [[[cog config_example(cog, """ allow_sql: false """) ]]] [[[end]]] To enable just the root user to execute SQL for all databases in your instance, use the following: [[[cog config_example(cog, """ allow_sql: id: root """) ]]] [[[end]]] To limit this ability for just one specific database, use this: [[[cog config_example(cog, """ databases: mydatabase: allow_sql: id: root """) ]]] [[[end]]] ["Authentication and permissions", "Access permissions in "] [{"href": "https://latest.datasette.io/fixtures", "label": "the database page"}, {"href": "https://latest.datasette.io/fixtures/facetable?_where=_city_id=1", "label": "like this"}]
authentication:authentication-permissions-other authentication authentication-permissions-other Other permissions in For all other permissions, you can use one or more "permissions" blocks in your datasette.yaml configuration file. To grant access to the permissions debug tool to all signed in users, you can grant permissions-debug to any actor with an id matching the wildcard * by adding this a the root of your configuration: [[[cog config_example(cog, """ permissions: debug-menu: id: '*' """) ]]] [[[end]]] To grant create-table to the user with id of editor for the docs database: [[[cog config_example(cog, """ databases: docs: permissions: create-table: id: editor """) ]]] [[[end]]] And for insert-row against the reports table in that docs database: [[[cog config_example(cog, """ databases: docs: tables: reports: permissions: insert-row: id: editor """) ]]] [[[end]]] The permissions debug tool can be useful for helping test permissions that you have configured in this way. ["Authentication and permissions"] []
authentication:createtokenview authentication createtokenview API Tokens Datasette includes a default mechanism for generating API tokens that can be used to authenticate requests. Authenticated users can create new API tokens using a form on the /-/create-token page. Tokens created in this way can be further restricted to only allow access to specific actions, or to limit those actions to specific databases, tables or queries. Created tokens can then be passed in the Authorization: Bearer $token header of HTTP requests to Datasette. A token created by a user will include that user's "id" in the token payload, so any permissions granted to that user based on their ID can be made available to the token as well. When one of these a token accompanies a request, the actor for that request will have the following shape: { "id": "user_id", "token": "dstok", "token_expires": 1667717426 } The "id" field duplicates the ID of the actor who first created the token. The "token" field identifies that this actor was authenticated using a Datasette signed token ( dstok ). The "token_expires" field, if present, indicates that the token will expire after that integer timestamp. The /-/create-token page cannot be accessed by actors that are authenticated with a "token": "some-value" property. This is to prevent API tokens from being used to create more tokens. Datasette plugins that implement their own form of API token authentication should follow this convention. You can disable the signed token feature entirely using the allow_signed_tokens setting. ["Authentication and permissions"] []
authentication:authentication-cli-create-token authentication authentication-cli-create-token datasette create-token You can also create tokens on the command line using the datasette create-token command. This command takes one required argument - the ID of the actor to be associated with the created token. You can specify a -e/--expires-after option in seconds. If omitted, the token will never expire. The command will sign the token using the DATASETTE_SECRET environment variable, if available. You can also pass the secret using the --secret option. This means you can run the command locally to create tokens for use with a deployed Datasette instance, provided you know that instance's secret. To create a token for the root actor that will expire in one hour: datasette create-token root --expires-after 3600 To create a token that never expires using a specific secret: datasette create-token root --secret my-secret-goes-here ["Authentication and permissions", "API Tokens"] []
authentication:authentication-cli-create-token-restrict authentication authentication-cli-create-token-restrict Restricting the actions that a token can perform Tokens created using datasette create-token ACTOR_ID will inherit all of the permissions of the actor that they are associated with. You can pass additional options to create tokens that are restricted to a subset of that actor's permissions. To restrict the token to just specific permissions against all available databases, use the --all option: datasette create-token root --all insert-row --all update-row This option can be passed as many times as you like. In the above example the token will only be allowed to insert and update rows. You can also restrict permissions such that they can only be used within specific databases: datasette create-token root --database mydatabase insert-row The resulting token will only be able to insert rows, and only to tables in the mydatabase database. Finally, you can restrict permissions to individual resources - tables, SQL views and named queries - within a specific database: datasette create-token root --resource mydatabase mytable insert-row These options have short versions: -a for --all , -d for --database and -r for --resource . You can add --debug to see a JSON representation of the token that has been created. Here's a full example: datasette create-token root \ --secret mysecret \ --all view-instance \ --all view-table \ --database docs view-query \ --resource docs documents insert-row \ --resource docs documents update-row \ --debug This example outputs the following: dstok_.eJxFizEKgDAMRe_y5w4qYrFXERGxDkVsMI0uxbubdjFL8l_ez1jhwEQCA6Fjjxp90qtkuHawzdjYrh8MFobLxZ_wBH0_gtnAF-hpS5VfmF8D_lnd97lHqUJgLd6sls4H1qwlhA.nH_7RecYHj5qSzvjhMU95iy0Xlc Decoded: { "a": "root", "token": "dstok", "t": 1670907246, "_r": { "a… ["Authentication and permissions", "API Tokens", "datasette create-token"] []
authentication:permissions-plugins authentication permissions-plugins Checking permissions in plugins Datasette plugins can check if an actor has permission to perform an action using the datasette.permission_allowed(...) method. Datasette core performs a number of permission checks, documented below . Plugins can implement the permission_allowed(datasette, actor, action, resource) plugin hook to participate in decisions about whether an actor should be able to perform a specified action. ["Authentication and permissions"] []
authentication:authentication-actor-matches-allow authentication authentication-actor-matches-allow actor_matches_allow() Plugins that wish to implement this same "allow" block permissions scheme can take advantage of the datasette.utils.actor_matches_allow(actor, allow) function: from datasette.utils import actor_matches_allow actor_matches_allow({"id": "root"}, {"id": "*"}) # returns True The currently authenticated actor is made available to plugins as request.actor . ["Authentication and permissions"] []
authentication:permissionsdebugview authentication permissionsdebugview The permissions debug tool The debug tool at /-/permissions is only available to the authenticated root user (or any actor granted the permissions-debug action). It shows the thirty most recent permission checks that have been carried out by the Datasette instance. It also provides an interface for running hypothetical permission checks against a hypothetical actor. This is a useful way of confirming that your configured permissions work in the way you expect. This is designed to help administrators and plugin authors understand exactly how permission checks are being carried out, in order to effectively configure Datasette's permission system. ["Authentication and permissions"] []
authentication:authentication-ds-actor authentication authentication-ds-actor The ds_actor cookie Datasette includes a default authentication plugin which looks for a signed ds_actor cookie containing a JSON actor dictionary. This is how the root actor mechanism works. Authentication plugins can set signed ds_actor cookies themselves like so: response = Response.redirect("/") datasette.set_actor_cookie(response, {"id": "cleopaws"}) The shape of data encoded in the cookie is as follows: { "a": { "id": "cleopaws" } } To implement logout in a plugin, use the delete_actor_cookie() method: response = Response.redirect("/") datasette.delete_actor_cookie(response) ["Authentication and permissions"] []
authentication:authentication-ds-actor-expiry authentication authentication-ds-actor-expiry Including an expiry time ds_actor cookies can optionally include a signed expiry timestamp, after which the cookies will no longer be valid. Authentication plugins may chose to use this mechanism to limit the lifetime of the cookie. For example, if a plugin implements single-sign-on against another source it may decide to set short-lived cookies so that if the user is removed from the SSO system their existing Datasette cookies will stop working shortly afterwards. To include an expiry pass expire_after= to datasette.set_actor_cookie() with a number of seconds. For example, to expire in 24 hours: response = Response.redirect("/") datasette.set_actor_cookie( response, {"id": "cleopaws"}, expire_after=60 * 60 * 24 ) The resulting cookie will encode data that looks something like this: { "a": { "id": "cleopaws" }, "e": "1jjSji" } ["Authentication and permissions", "The ds_actor cookie"] []
authentication:logoutview authentication logoutview The /-/logout page The page at /-/logout provides the ability to log out of a ds_actor cookie authentication session. ["Authentication and permissions", "The ds_actor cookie"] []
authentication:id1 authentication id1 Built-in permissions This section lists all of the permission checks that are carried out by Datasette core, along with the resource if it was passed. ["Authentication and permissions"] []
authentication:permissions-view-instance authentication permissions-view-instance view-instance Top level permission - Actor is allowed to view any pages within this instance, starting at https://latest.datasette.io/ Default allow . ["Authentication and permissions", "Built-in permissions"] [{"href": "https://latest.datasette.io/", "label": "https://latest.datasette.io/"}]
authentication:permissions-view-database authentication permissions-view-database view-database Actor is allowed to view a database page, e.g. https://latest.datasette.io/fixtures resource - string The name of the database Default allow . ["Authentication and permissions", "Built-in permissions"] [{"href": "https://latest.datasette.io/fixtures", "label": "https://latest.datasette.io/fixtures"}]
authentication:permissions-view-database-download authentication permissions-view-database-download view-database-download Actor is allowed to download a database, e.g. https://latest.datasette.io/fixtures.db resource - string The name of the database Default allow . ["Authentication and permissions", "Built-in permissions"] [{"href": "https://latest.datasette.io/fixtures.db", "label": "https://latest.datasette.io/fixtures.db"}]
authentication:permissions-view-table authentication permissions-view-table view-table Actor is allowed to view a table (or view) page, e.g. https://latest.datasette.io/fixtures/complex_foreign_keys resource - tuple: (string, string) The name of the database, then the name of the table Default allow . ["Authentication and permissions", "Built-in permissions"] [{"href": "https://latest.datasette.io/fixtures/complex_foreign_keys", "label": "https://latest.datasette.io/fixtures/complex_foreign_keys"}]
authentication:permissions-view-query authentication permissions-view-query view-query Actor is allowed to view (and execute) a canned query page, e.g. https://latest.datasette.io/fixtures/pragma_cache_size - this includes executing Writable canned queries . resource - tuple: (string, string) The name of the database, then the name of the canned query Default allow . ["Authentication and permissions", "Built-in permissions"] [{"href": "https://latest.datasette.io/fixtures/pragma_cache_size", "label": "https://latest.datasette.io/fixtures/pragma_cache_size"}]
authentication:permissions-insert-row authentication permissions-insert-row insert-row Actor is allowed to insert rows into a table. resource - tuple: (string, string) The name of the database, then the name of the table Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-delete-row authentication permissions-delete-row delete-row Actor is allowed to delete rows from a table. resource - tuple: (string, string) The name of the database, then the name of the table Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-update-row authentication permissions-update-row update-row Actor is allowed to update rows in a table. resource - tuple: (string, string) The name of the database, then the name of the table Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-create-table authentication permissions-create-table create-table Actor is allowed to create a database table. resource - string The name of the database Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-alter-table authentication permissions-alter-table alter-table Actor is allowed to alter a database table. resource - tuple: (string, string) The name of the database, then the name of the table Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-drop-table authentication permissions-drop-table drop-table Actor is allowed to drop a database table. resource - tuple: (string, string) The name of the database, then the name of the table Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-execute-sql authentication permissions-execute-sql execute-sql Actor is allowed to run arbitrary SQL queries against a specific database, e.g. https://latest.datasette.io/fixtures?sql=select+100 resource - string The name of the database Default allow . See also the default_allow_sql setting . ["Authentication and permissions", "Built-in permissions"] [{"href": "https://latest.datasette.io/fixtures?sql=select+100", "label": "https://latest.datasette.io/fixtures?sql=select+100"}]
authentication:permissions-permissions-debug authentication permissions-permissions-debug permissions-debug Actor is allowed to view the /-/permissions debug page. Default deny . ["Authentication and permissions", "Built-in permissions"] []
authentication:permissions-debug-menu authentication permissions-debug-menu debug-menu Controls if the various debug pages are displayed in the navigation menu. Default deny . ["Authentication and permissions", "Built-in permissions"] []
binary_data:binary binary_data binary Binary data SQLite tables can contain binary data in BLOB columns. Datasette includes special handling for these binary values. The Datasette interface detects binary values and provides a link to download their content, for example on https://latest.datasette.io/fixtures/binary_data Binary data is represented in .json exports using Base64 encoding. https://latest.datasette.io/fixtures/binary_data.json?_shape=array [ { "rowid": 1, "data": { "$base64": true, "encoded": "FRwCx60F/g==" } }, { "rowid": 2, "data": { "$base64": true, "encoded": "FRwDx60F/g==" } }, { "rowid": 3, "data": null } ] [] [{"href": "https://latest.datasette.io/fixtures/binary_data", "label": "https://latest.datasette.io/fixtures/binary_data"}, {"href": "https://latest.datasette.io/fixtures/binary_data.json?_shape=array", "label": "https://latest.datasette.io/fixtures/binary_data.json?_shape=array"}]
binary_data:binary-linking binary_data binary-linking Linking to binary downloads The .blob output format is used to return binary data. It requires a _blob_column= query string argument specifying which BLOB column should be downloaded, for example: https://latest.datasette.io/fixtures/binary_data/1.blob?_blob_column=data This output format can also be used to return binary data from an arbitrary SQL query. Since such queries do not specify an exact row, an additional ?_blob_hash= parameter can be used to specify the SHA-256 hash of the value that is being linked to. Consider the query select data from binary_data - demonstrated here . That page links to the binary value downloads. Those links look like this: https://latest.datasette.io/fixtures.blob?sql=select+data+from+binary_data&_blob_column=data&_blob_hash=f3088978da8f9aea479ffc7f631370b968d2e855eeb172bea7f6c7a04262bb6d These .blob links are also returned in the .csv exports Datasette provides for binary tables and queries, since the CSV format does not have a mechanism for representing binary data. ["Binary data"] [{"href": "https://latest.datasette.io/fixtures/binary_data/1.blob?_blob_column=data", "label": "https://latest.datasette.io/fixtures/binary_data/1.blob?_blob_column=data"}, {"href": "https://latest.datasette.io/fixtures?sql=select+data+from+binary_data", "label": "demonstrated here"}, {"href": "https://latest.datasette.io/fixtures.blob?sql=select+data+from+binary_data&_blob_column=data&_blob_hash=f3088978da8f9aea479ffc7f631370b968d2e855eeb172bea7f6c7a04262bb6d", "label": "https://latest.datasette.io/fixtures.blob?sql=select+data+from+binary_data&_blob_column=data&_blob_hash=f3088978da8f9aea479ffc7f631370b968d2e855eeb172bea7f6c7a04262bb6d"}]
binary_data:binary-plugins binary_data binary-plugins Binary plugins Several Datasette plugins are available that change the way Datasette treats binary data. datasette-render-binary modifies Datasette's default interface to show an automatic guess at what type of binary data is being stored, along with a visual representation of the binary value that displays ASCII strings directly in the interface. datasette-render-images detects common image formats and renders them as images directly in the Datasette interface. datasette-media allows Datasette interfaces to be configured to serve binary files from configured SQL queries, and includes the ability to resize images directly before serving them. ["Binary data"] [{"href": "https://github.com/simonw/datasette-render-binary", "label": "datasette-render-binary"}, {"href": "https://github.com/simonw/datasette-render-images", "label": "datasette-render-images"}, {"href": "https://github.com/simonw/datasette-media", "label": "datasette-media"}]
changelog:id1 changelog id1 Changelog   [] []
changelog:v1-0-a19 changelog v1-0-a19 1.0a19 (2025-04-21) Tiny cosmetic bug fix for mobile display of table rows. ( #2479 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2479", "label": "#2479"}]
changelog:v1-0-a18 changelog v1-0-a18 1.0a18 (2025-04-16) Fix for incorrect foreign key references in the internal database schema. ( #2466 ) The prepare_connection() hook no longer runs for the internal database. ( #2468 ) Fixed bug where link: HTTP headers used invalid syntax. ( #2470 ) No longer tested against Python 3.8. Now tests against Python 3.13. FTS tables are now hidden by default if they correspond to a content table. ( #2477 ) Fixed bug with foreign key links to rows in databases with filenames containing a special character. Thanks, Jack Stratton . ( #2476 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2466", "label": "#2466"}, {"href": "https://github.com/simonw/datasette/issues/2468", "label": "#2468"}, {"href": "https://github.com/simonw/datasette/issues/2470", "label": "#2470"}, {"href": "https://github.com/simonw/datasette/issues/2477", "label": "#2477"}, {"href": "https://github.com/phroa", "label": "Jack Stratton"}, {"href": "https://github.com/simonw/datasette/pull/2476", "label": "#2476"}]
changelog:v1-0-a17 changelog v1-0-a17 1.0a17 (2025-02-06) DATASETTE_SSL_KEYFILE and DATASETTE_SSL_CERTFILE environment variables as alternatives to --ssl-keyfile and --ssl-certfile . Thanks, Alex Garcia. ( #2422 ) SQLITE_EXTENSIONS environment variable has been renamed to DATASETTE_LOAD_EXTENSION . ( #2424 ) datasette serve environment variables are now documented here . The register_magic_parameters(datasette) plugin hook can now register async functions. ( #2441 ) Datasette is now tested against Python 3.13. Breadcrumbs on database and table pages now include a consistent self-link for resetting query string parameters. ( #2454 ) Fixed issue where Datasette could crash on metadata.json with nested values. ( #2455 ) New internal methods datasette.set_actor_cookie() and datasette.delete_actor_cookie() , described here . ( #1690 ) /-/permissions page now shows a list of all permissions registered by plugins. ( #1943 ) If a table has a single unique text column Datasette now detects that as the foreign key label for that table. ( #2458 ) The /-/permissions page now includes options for filtering or exclude permission checks recorded against the current user. ( #2460 ) Fixed a bug where replacing a database with a new one with the same name did not pick up the new database correctly. ( #2465 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2422", "label": "#2422"}, {"href": "https://github.com/simonw/datasette/issues/2424", "label": "#2424"}, {"href": "https://github.com/simonw/datasette/issues/2441", "label": "#2441"}, {"href": "https://github.com/simonw/datasette/issues/2454", "label": "#2454"}, {"href": "https://github.com/simonw/datasette/issues/2455", "label": "#2455"}, {"href": "https://github.com/simonw/datasette/issues/1690", "label": "#1690"}, {"href": "https://github.com/simonw/datasette/issues/1943", "label": "#1943"}, {"href": "https://github.com/simonw/datasette/issues/2458", "label": "#2458"}, {"href": "https://github.com/simonw/datasette/issues/2460", "label": "#2460"}, {"href": "https://github.com/simonw/datasette/issues/2465", "label": "#2465"}]
changelog:id2 changelog id2 0.65.1 (2024-11-28) Fixed bug with upgraded HTTPX 0.28.0 dependency. ( #2443 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2443", "label": "#2443"}]
changelog:id3 changelog id3 0.65 (2024-10-07) Upgrade for compatibility with Python 3.13 (by vendoring Pint dependency). ( #2434 ) Dropped support for Python 3.8. ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2434", "label": "#2434"}]
changelog:v1-0-a16 changelog v1-0-a16 1.0a16 (2024-09-05) This release focuses on performance, in particular against large tables, and introduces some minor breaking changes for CSS styling in Datasette plugins. Removed the unit conversions feature and its dependency, Pint. This means Datasette is now compatible with the upcoming Python 3.13. ( #2400 , #2320 ) The datasette --pdb option now uses the ipdb debugger if it is installed. You can install it using datasette install ipdb . Thanks, Tiago Ilieve . ( #2342 ) Fixed a confusing error that occurred if metadata.json contained nested objects. ( #2403 ) Fixed a bug with ?_trace=1 where it returned a blank page if the response was larger than 256KB. ( #2404 ) Tracing mechanism now also displays SQL queries that returned errors or ran out of time. datasette-pretty-traces 0.5 includes support for displaying this new type of trace. ( #2405 ) Fixed a text spacing with table descriptions on the homepage. ( #2399 ) Performance improvements for large tables: Suggested facets now only consider the first 1000 rows. ( #2406 ) Improved performance of date facet suggestion against large tables. ( #2407 ) Row counts stop at 10,000 rows when listing tables. ( #2398 ) … ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2400", "label": "#2400"}, {"href": "https://github.com/simonw/datasette/issues/2320", "label": "#2320"}, {"href": "https://github.com/gotcha/ipdb", "label": "ipdb"}, {"href": "https://github.com/myhro", "label": "Tiago Ilieve"}, {"href": "https://github.com/simonw/datasette/pull/2342", "label": "#2342"}, {"href": "https://github.com/simonw/datasette/issues/2403", "label": "#2403"}, {"href": "https://github.com/simonw/datasette/issues/2404", "label": "#2404"}, {"href": "https://github.com/simonw/datasette-pretty-traces/releases/tag/0.5", "label": "datasette-pretty-traces 0.5"}, {"href": "https://github.com/simonw/datasette/issues/2405", "label": "#2405"}, {"href": "https://github.com/simonw/datasette/issues/2399", "label": "#2399"}, {"href": "https://github.com/simonw/datasette/issues/2406", "label": "#2406"}, {"href": "https://github.com/simonw/datasette/issues/2407", "label": "#2407"}, {"href": "https://github.com/simonw/datasette/issues/2398", "label": "#2398"}, {"href": "https://github.com/simonw/datasette/issues/2408", "label": "#2408"}, {"href": "https://github.com/simonw/datasette/issues/2414", "label": "#2414"}, {"href": "https://github.com/simonw/datasette/issues/2415", "label": "#2415"}, {"href": "https://github.com/simonw/datasette/issues/2420", "label": "#2420"}]
changelog:v1-0-a15 changelog v1-0-a15 1.0a15 (2024-08-15) Datasette now defaults to hiding SQLite "shadow" tables, as seen in extensions such as SQLite FTS and sqlite-vec . Virtual tables that it makes sense to display, such as FTS core tables, are no longer hidden. Thanks, Alex Garcia . ( #2296 ) Fixed bug where running Datasette with one or more -s/--setting options could over-ride settings that were present in datasette.yml . ( #2389 ) The Datasette homepage is now duplicated at /-/ , using the default index.html template. This ensures that the information on that page is still accessible even if the Datasette homepage has been customized using a custom index.html template, for example on sites like datasette.io . ( #2393 ) Failed CSRF checks now display a more user-friendly error page. ( #2390 ) Fixed a bug where the json1 extension was not correctly detected on the /-/versions page. Thanks, Seb Bacon . ( #2326 ) Fixed a bug where the Datasette write API did not correctly accept Content-Type: application/json; charset=utf-8 . ( #2384 ) Fixed a bug where Datasette would fail to start if metadata.yml contained a queries block. ( #2386 ) ["Changelog"] [{"href": "https://github.com/asg017/sqlite-vec", "label": "sqlite-vec"}, {"href": "https://github.com/asg017", "label": "Alex Garcia"}, {"href": "https://github.com/simonw/datasette/issues/2296", "label": "#2296"}, {"href": "https://github.com/simonw/datasette/issues/2389", "label": "#2389"}, {"href": "https://datasette.io/", "label": "datasette.io"}, {"href": "https://github.com/simonw/datasette/issues/2393", "label": "#2393"}, {"href": "https://github.com/simonw/datasette/issues/2390", "label": "#2390"}, {"href": "https://github.com/sebbacon", "label": "Seb Bacon"}, {"href": "https://github.com/simonw/datasette/issues/2326", "label": "#2326"}, {"href": "https://github.com/simonw/datasette/issues/2384", "label": "#2384"}, {"href": "https://github.com/simonw/datasette/pull/2386", "label": "#2386"}]
changelog:v1-0-a14 changelog v1-0-a14 1.0a14 (2024-08-05) This alpha introduces significant changes to Datasette's Metadata system, some of which represent breaking changes in advance of the full 1.0 release. The new Upgrade guide document provides detailed coverage of those breaking changes and how they affect plugin authors and Datasette API consumers. The /databasename?sql= interface and JSON API for executing arbitrary SQL queries can now be found at /databasename/-/query?sql= . Requests with a ?sql= parameter to the old endpoints will be redirected. Thanks, Alex Garcia . ( #2360 ) Metadata about tables, databases, instances and columns is now stored in Datasette's internal database . Thanks, Alex Garcia. ( #2341 ) Database write connections now execute using the IMMEDIATE isolation level for SQLite. This should help avoid a rare SQLITE_BUSY error that could occur when a transaction upgraded to a write mid-flight. ( #2358 ) Fix for a bug where canned queries with named parameters could fail against SQLite 3.46. ( #2353 ) Datasette now serves E-Tag headers for static files. Thanks, Agustin Bacigalup . ( #2306 ) Dropdown menus now use a z-index that should avoid them being hidden by plugins. ( #2311 ) Incorrect table and row names are no longer reflected back on the resulting 404 page. ( #2359 ) Improved documentation for async usage of the track_event(datasette, event) hook. ( #2319 ) Fixed some HTTPX deprecation warnings. ( #2307 ) Datasette now serves a <html lang="en"> attrib… ["Changelog"] [{"href": "https://github.com/asg017", "label": "Alex Garcia"}, {"href": "https://github.com/simonw/datasette/issues/2360", "label": "#2360"}, {"href": "https://github.com/simonw/datasette/issues/2341", "label": "#2341"}, {"href": "https://github.com/simonw/datasette/issues/2358", "label": "#2358"}, {"href": "https://github.com/simonw/datasette/issues/2353", "label": "#2353"}, {"href": "https://github.com/redraw", "label": "Agustin Bacigalup"}, {"href": "https://github.com/simonw/datasette/pull/2306", "label": "#2306"}, {"href": "https://github.com/simonw/datasette/issues/2311", "label": "#2311"}, {"href": "https://github.com/simonw/datasette/issues/2359", "label": "#2359"}, {"href": "https://github.com/simonw/datasette/issues/2319", "label": "#2319"}, {"href": "https://github.com/simonw/datasette/issues/2307", "label": "#2307"}, {"href": "https://github.com/CharlesNepote", "label": "Charles Nepote"}, {"href": "https://github.com/simonw/datasette/issues/2348", "label": "#2348"}, {"href": "https://github.com/simonw/datasette/pull/2352", "label": "#2352"}, {"href": "https://github.com/simonw/datasette/issues/2375", "label": "#2375"}]
changelog:id4 changelog id4 0.64.8 (2024-06-21) Security improvement: 404 pages used to reflect content from the URL path, which could be used to display misleading information to Datasette users. 404 errors no longer display additional information from the URL. ( #2359 ) Backported a better fix for correctly extracting named parameters from canned query SQL against SQLite 3.46.0. ( #2353 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2359", "label": "#2359"}, {"href": "https://github.com/simonw/datasette/issues/2353", "label": "#2353"}]
changelog:id5 changelog id5 0.64.7 (2024-06-12) Fixed a bug where canned queries with named parameters threw an error when run against SQLite 3.46.0. ( #2353 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2353", "label": "#2353"}]
changelog:v1-0-a13 changelog v1-0-a13 1.0a13 (2024-03-12) Each of the key concepts in Datasette now has an actions menu , which plugins can use to add additional functionality targeting that entity. Plugin hook: view_actions() for actions that can be applied to a SQL view. ( #2297 ) Plugin hook: homepage_actions() for actions that apply to the instance homepage. ( #2298 ) Plugin hook: row_actions() for actions that apply to the row page. ( #2299 ) Action menu items for all of the *_actions() plugin hooks can now return an optional "description" key, which will be displayed in the menu below the action label. ( #2294 ) Plugin hooks documentation page is now organized with additional headings. ( #2300 ) Improved the display of action buttons on pages that also display metadata. ( #2286 ) The header and footer of the page now uses a subtle gradient effect, and options in the navigation menu are better visually defined. ( #2302 ) Table names that start with an underscore now default to hidden. ( #2104 ) pragma_table_list has been added to the allow-list of SQLite pragma functions supported by Datasette. select * from pragma_table_list() is no longer blocked. ( #2104 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2297", "label": "#2297"}, {"href": "https://github.com/simonw/datasette/issues/2298", "label": "#2298"}, {"href": "https://github.com/simonw/datasette/issues/2299", "label": "#2299"}, {"href": "https://github.com/simonw/datasette/issues/2294", "label": "#2294"}, {"href": "https://github.com/simonw/datasette/issues/2300", "label": "#2300"}, {"href": "https://github.com/simonw/datasette/issues/2286", "label": "#2286"}, {"href": "https://github.com/simonw/datasette/issues/2302", "label": "#2302"}, {"href": "https://github.com/simonw/datasette/issues/2104", "label": "#2104"}, {"href": "https://github.com/simonw/datasette/issues/2104#issuecomment-1982352475", "label": "#2104"}]
changelog:v1-0-a12 changelog v1-0-a12 1.0a12 (2024-02-29) New query_actions() plugin hook, similar to table_actions() and database_actions() . Can be used to add a menu of actions to the canned query or arbitrary SQL query page. ( #2283 ) New design for the button that opens the query, table and database actions menu. ( #2281 ) "does not contain" table filter for finding rows that do not contain a string. ( #2287 ) Fixed a bug in the makeColumnActions(columnDetails) JavaScript plugin mechanism where the column action menu was not fully reset in between each interaction. ( #2289 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2283", "label": "#2283"}, {"href": "https://github.com/simonw/datasette/issues/2281", "label": "#2281"}, {"href": "https://github.com/simonw/datasette/issues/2287", "label": "#2287"}, {"href": "https://github.com/simonw/datasette/issues/2289", "label": "#2289"}]
changelog:v1-0-a11 changelog v1-0-a11 1.0a11 (2024-02-19) The "replace": true argument to the /db/table/-/insert API now requires the actor to have the update-row permission. ( #2279 ) Fixed some UI bugs in the interactive permissions debugging tool. ( #2278 ) The column action menu now aligns better with the cog icon, and positions itself taking into account the width of the browser window. ( #2263 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2279", "label": "#2279"}, {"href": "https://github.com/simonw/datasette/issues/2278", "label": "#2278"}, {"href": "https://github.com/simonw/datasette/issues/2263", "label": "#2263"}]
changelog:v1-0-a10 changelog v1-0-a10 1.0a10 (2024-02-17) The only changes in this alpha correspond to the way Datasette handles database transactions. ( #2277 ) The database.execute_write_fn() method has a new transaction=True parameter. This defaults to True which means all functions executed using this method are now automatically wrapped in a transaction - previously the functions needed to roll transaction handling on their own, and many did not. Pass transaction=False to execute_write_fn() if you want to manually handle transactions in your function. Several internal Datasette features, including parts of the JSON write API , had been failing to wrap their operations in a transaction. This has been fixed by the new transaction=True default. ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2277", "label": "#2277"}]
changelog:v1-0-a9 changelog v1-0-a9 1.0a9 (2024-02-16) This alpha release adds basic alter table support to the Datasette Write API and fixes a permissions bug relating to the /upsert API endpoint. ["Changelog"] []
changelog:alter-table-support-for-create-insert-upsert-and-update changelog alter-table-support-for-create-insert-upsert-and-update Alter table support for create, insert, upsert and update The JSON write API can now be used to apply simple alter table schema changes, provided the acting actor has the new alter-table permission. ( #2101 ) The only alter operation supported so far is adding new columns to an existing table. The /db/-/create API now adds new columns during large operations to create a table based on incoming example "rows" , in the case where one of the later rows includes columns that were not present in the earlier batches. This requires the create-table but not the alter-table permission. When /db/-/create is called with rows in a situation where the table may have been already created, an "alter": true key can be included to indicate that any missing columns from the new rows should be added to the table. This requires the alter-table permission. /db/table/-/insert and /db/table/-/upsert and /db/table/row-pks/-/update all now also accept "alter": true , depending on the alter-table permission. Operations that alter a table now fire the new alter-table event . ["Changelog", "1.0a9 (2024-02-16)"] [{"href": "https://github.com/simonw/datasette/issues/2101", "label": "#2101"}]
changelog:permissions-fix-for-the-upsert-api changelog permissions-fix-for-the-upsert-api Permissions fix for the upsert API The /database/table/-/upsert API had a minor permissions bug, only affecting Datasette instances that had configured the insert-row and update-row permissions to apply to a specific table rather than the database or instance as a whole. Full details in issue #2262 . To avoid similar mistakes in the future the datasette.permission_allowed() method now specifies default= as a keyword-only argument. ["Changelog", "1.0a9 (2024-02-16)"] [{"href": "https://github.com/simonw/datasette/issues/2262", "label": "#2262"}]
changelog:permission-checks-now-consider-opinions-from-every-plugin changelog permission-checks-now-consider-opinions-from-every-plugin Permission checks now consider opinions from every plugin The datasette.permission_allowed() method previously consulted every plugin that implemented the permission_allowed() plugin hook and obeyed the opinion of the last plugin to return a value. ( #2275 ) Datasette now consults every plugin and checks to see if any of them returned False (the veto rule), and if none of them did, it then checks to see if any of them returned True . This is explained at length in the new documentation covering How permissions are resolved . ["Changelog", "1.0a9 (2024-02-16)"] [{"href": "https://github.com/simonw/datasette/issues/2275", "label": "#2275"}]
changelog:other-changes changelog other-changes Other changes The new DATASETTE_TRACE_PLUGINS=1 environment variable turns on detailed trace output for every executed plugin hook, useful for debugging and understanding how the plugin system works at a low level. ( #2274 ) Datasette on Python 3.9 or above marks its non-cryptographic uses of the MD5 hash function as usedforsecurity=False , for compatibility with FIPS systems. ( #2270 ) SQL relating to Datasette's internal database now executes inside a transaction, avoiding a potential database locked error. ( #2273 ) The /-/threads debug page now identifies the database in the name associated with each dedicated write thread. ( #2265 ) The /db/-/create API now fires a insert-rows event if rows were inserted after the table was created. ( #2260 ) ["Changelog", "1.0a9 (2024-02-16)"] [{"href": "https://github.com/simonw/datasette/issues/2274", "label": "#2274"}, {"href": "https://github.com/simonw/datasette/issues/2270", "label": "#2270"}, {"href": "https://github.com/simonw/datasette/issues/2273", "label": "#2273"}, {"href": "https://github.com/simonw/datasette/issues/2265", "label": "#2265"}, {"href": "https://github.com/simonw/datasette/issues/2260", "label": "#2260"}]
changelog:v1-0-a8 changelog v1-0-a8 1.0a8 (2024-02-07) This alpha release continues the migration of Datasette's configuration from metadata.yaml to the new datasette.yaml configuration file, introduces a new system for JavaScript plugins and adds several new plugin hooks. See Datasette 1.0a8: JavaScript plugins, new plugin hooks and plugin configuration in datasette.yaml for an annotated version of these release notes. ["Changelog"] [{"href": "https://simonwillison.net/2024/Feb/7/datasette-1a8/", "label": "Datasette 1.0a8: JavaScript plugins, new plugin hooks and plugin configuration in datasette.yaml"}]
changelog:configuration changelog configuration Configuration Plugin configuration now lives in the datasette.yaml configuration file , passed to Datasette using the -c/--config option. Thanks, Alex Garcia. ( #2093 ) datasette -c datasette.yaml Where datasette.yaml contains configuration that looks like this: plugins: datasette-cluster-map: latitude_column: xlat longitude_column: xlon Previously plugins were configured in metadata.yaml , which was confusing as plugin settings were unrelated to database and table metadata. The -s/--setting option can now be used to set plugin configuration as well. See Configuration via the command-line for details. ( #2252 ) The above YAML configuration example using -s/--setting looks like this: datasette mydatabase.db \ -s plugins.datasette-cluster-map.latitude_column xlat \ -s plugins.datasette-cluster-map.longitude_column xlon The new /-/config page shows the current instance configuration, after redacting keys that could contain sensitive data such as API keys or passwords. ( #2254 ) Existing Datasette installations may already have configuration set in metadata.yaml that should be migrated to datasette.yaml . To avoid breaking these installations, Datasette will silently treat table configuration, plugin configuration and allow blocks in metadata as if they had been specified in configuration instead. ( #2247 ) ( #2248 ) ( #2249 ) Note that the datasette publish command has not yet been updated to accept a datasette.yaml configuration file. This will be addressed in #2195 but for the moment you can include those settings in metadata.yaml instead. ["Changelog", "1.0a8 (2024-02-07)"] [{"href": "https://github.com/simonw/datasette/issues/2093", "label": "#2093"}, {"href": "https://github.com/simonw/datasette/issues/2252", "label": "#2252"}, {"href": "https://github.com/simonw/datasette/issues/2254", "label": "#2254"}, {"href": "https://github.com/simonw/datasette/issues/2247", "label": "#2247"}, {"href": "https://github.com/simonw/datasette/issues/2248", "label": "#2248"}, {"href": "https://github.com/simonw/datasette/issues/2249", "label": "#2249"}, {"href": "https://github.com/simonw/datasette/issues/2195", "label": "#2195"}]
changelog:javascript-plugins changelog javascript-plugins JavaScript plugins Datasette now includes a JavaScript plugins mechanism , allowing JavaScript to customize Datasette in a way that can collaborate with other plugins. This provides two initial hooks, with more to come in the future: makeAboveTablePanelConfigs() can add additional panels to the top of the table page. makeColumnActions() can add additional actions to the column menu. Thanks Cameron Yick for contributing this feature. ( #2052 ) ["Changelog", "1.0a8 (2024-02-07)"] [{"href": "https://github.com/hydrosquall", "label": "Cameron Yick"}, {"href": "https://github.com/simonw/datasette/pull/2052", "label": "#2052"}]
changelog:plugin-hooks changelog plugin-hooks Plugin hooks New jinja2_environment_from_request(datasette, request, env) plugin hook, which can be used to customize the current Jinja environment based on the incoming request. This can be used to modify the template lookup path based on the incoming request hostname, among other things. ( #2225 ) New family of template slot plugin hooks : top_homepage , top_database , top_table , top_row , top_query , top_canned_query . Plugins can use these to provide additional HTML to be injected at the top of the corresponding pages. ( #1191 ) New track_event() mechanism for plugins to emit and receive events when certain events occur within Datasette. ( #2240 ) Plugins can register additional event classes using register_events(datasette) . They can then trigger those events with the datasette.track_event(event) internal method. Plugins can subscribe to notifications of events using the track_event(datasette, event) plugin hook. Datasette core now emits login , logout , create-token , create-table , drop-table , insert-rows , upsert-rows , update-row , delete-row events, documented here . … ["Changelog", "1.0a8 (2024-02-07)"] [{"href": "https://github.com/simonw/datasette/issues/2225", "label": "#2225"}, {"href": "https://github.com/simonw/datasette/issues/1191", "label": "#1191"}, {"href": "https://github.com/simonw/datasette/issues/2240", "label": "#2240"}, {"href": "https://github.com/simonw/datasette/issues/2218", "label": "#2218"}]
changelog:documentation changelog documentation Documentation Documentation describing how to write tests that use signed actor cookies using datasette.client.actor_cookie() . ( #1830 ) Documentation on how to register a plugin for the duration of a test . ( #2234 ) The configuration documentation now shows examples of both YAML and JSON for each setting. ["Changelog", "1.0a8 (2024-02-07)"] [{"href": "https://github.com/simonw/datasette/issues/1830", "label": "#1830"}, {"href": "https://github.com/simonw/datasette/issues/2234", "label": "#2234"}]
changelog:minor-fixes changelog minor-fixes Minor fixes Datasette no longer attempts to run SQL queries in parallel when rendering a table page, as this was leading to some rare crashing bugs. ( #2189 ) Fixed warning: DeprecationWarning: pkg_resources is deprecated as an API ( #2057 ) Fixed bug where ?_extra=columns parameter returned an incorrectly shaped response. ( #2230 ) ["Changelog", "1.0a8 (2024-02-07)"] [{"href": "https://github.com/simonw/datasette/issues/2189", "label": "#2189"}, {"href": "https://github.com/simonw/datasette/issues/2057", "label": "#2057"}, {"href": "https://github.com/simonw/datasette/issues/2230", "label": "#2230"}]
changelog:id6 changelog id6 0.64.6 (2023-12-22) Fixed a bug where CSV export with expanded labels could fail if a foreign key reference did not correctly resolve. ( #2214 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2214", "label": "#2214"}]
changelog:id7 changelog id7 0.64.5 (2023-10-08) Dropped dependency on click-default-group-wheel , which could cause a dependency conflict. ( #2197 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2197", "label": "#2197"}]
changelog:v1-0-a7 changelog v1-0-a7 1.0a7 (2023-09-21) Fix for a crashing bug caused by viewing the table page for a named in-memory database. ( #2189 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2189", "label": "#2189"}]
changelog:id8 changelog id8 0.64.4 (2023-09-21) Fix for a crashing bug caused by viewing the table page for a named in-memory database. ( #2189 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2189", "label": "#2189"}]
changelog:v1-0-a6 changelog v1-0-a6 1.0a6 (2023-09-07) New plugin hook: actors_from_ids(datasette, actor_ids) and an internal method to accompany it, await .actors_from_ids(actor_ids) . This mechanism is intended to be used by plugins that may need to display the actor who was responsible for something managed by that plugin: they can now resolve the recorded IDs of actors into the full actor objects. ( #2181 ) DATASETTE_LOAD_PLUGINS environment variable for controlling which plugins are loaded by Datasette. ( #2164 ) Datasette now checks if the user has permission to view a table linked to by a foreign key before turning that foreign key into a clickable link. ( #2178 ) The execute-sql permission now implies that the actor can also view the database and instance. ( #2169 ) Documentation describing a pattern for building plugins that themselves define further hooks for other plugins. ( #1765 ) Datasette is now tested against the Python 3.12 preview. ( #2175 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2181", "label": "#2181"}, {"href": "https://github.com/simonw/datasette/issues/2164", "label": "#2164"}, {"href": "https://github.com/simonw/datasette/issues/2178", "label": "#2178"}, {"href": "https://github.com/simonw/datasette/issues/2169", "label": "#2169"}, {"href": "https://github.com/simonw/datasette/issues/1765", "label": "#1765"}, {"href": "https://github.com/simonw/datasette/pull/2175", "label": "#2175"}]
changelog:v1-0-a5 changelog v1-0-a5 1.0a5 (2023-08-29) When restrictions are applied to API tokens , those restrictions now behave slightly differently: applying the view-table restriction will imply the ability to view-database for the database containing that table, and both view-table and view-database will imply view-instance . Previously you needed to create a token with restrictions that explicitly listed view-instance and view-database and view-table in order to view a table without getting a permission denied error. ( #2102 ) New datasette.yaml (or .json ) configuration file, which can be specified using datasette -c path-to-file . The goal here to consolidate settings, plugin configuration, permissions, canned queries, and other Datasette configuration into a single single file, separate from metadata.yaml . The legacy settings.json config file used for Configuration directory mode has been removed, and datasette.yaml has a "settings" section where the same settings key/value pairs can be included. In the next future alpha release, more configuration such as plugins/permissions/canned queries will be moved to the datasette.yaml file. See #2093 for more details. Thanks, Alex Garcia. The -s/--setting option can now take dotted paths to nested settings. These will then be used to set or over-ride the same options as are present in the new configuration file. ( #2156 ) New --actor '{"id": "json-goes-here"}' option for use with datasette --get to treat the simulated request as being made by a specific actor, see datasette --get . ( #2153 ) The Datasette _internal database has had some changes. It no longer shows up in the datasette.databases list by default, and is now instead available to plugins using the datasette.get_internal_database() . Plugins are invited to use this as a private data… ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2102", "label": "#2102"}, {"href": "https://github.com/simonw/datasette/issues/2093", "label": "#2093"}, {"href": "https://github.com/simonw/datasette/issues/2156", "label": "#2156"}, {"href": "https://github.com/simonw/datasette/issues/2153", "label": "#2153"}, {"href": "https://github.com/simonw/datasette/issues/2157", "label": "#2157"}]
changelog:v1-0-a4 changelog v1-0-a4 1.0a4 (2023-08-21) This alpha fixes a security issue with the /-/api API explorer. On authenticated Datasette instances (instances protected using plugins such as datasette-auth-passwords ) the API explorer interface could reveal the names of databases and tables within the protected instance. The data stored in those tables was not revealed. For more information and workarounds, read the security advisory . The issue has been present in every previous alpha version of Datasette 1.0: versions 1.0a0, 1.0a1, 1.0a2 and 1.0a3. Also in this alpha: The new datasette plugins --requirements option outputs a list of currently installed plugins in Python requirements.txt format, useful for duplicating that installation elsewhere. ( #2133 ) Writable canned queries can now define a on_success_message_sql field in their configuration, containing a SQL query that should be executed upon successful completion of the write operation in order to generate a message to be shown to the user. ( #2138 ) The automatically generated border color for a database is now shown in more places around the application. ( #2119 ) Every instance of example shell script code in the documentation should now include a working copy button, free from additional syntax. ( #2140 ) ["Changelog"] [{"href": "https://datasette.io/plugins/datasette-auth-passwords", "label": "datasette-auth-passwords"}, {"href": "https://github.com/simonw/datasette/security/advisories/GHSA-7ch3-7pp7-7cpq", "label": "the security advisory"}, {"href": "https://github.com/simonw/datasette/issues/2133", "label": "#2133"}, {"href": "https://github.com/simonw/datasette/issues/2138", "label": "#2138"}, {"href": "https://github.com/simonw/datasette/issues/2119", "label": "#2119"}, {"href": "https://github.com/simonw/datasette/issues/2140", "label": "#2140"}]
changelog:v1-0-a3 changelog v1-0-a3 1.0a3 (2023-08-09) This alpha release previews the updated design for Datasette's default JSON API. ( #782 ) The new default JSON representation for both table pages ( /dbname/table.json ) and arbitrary SQL queries ( /dbname.json?sql=... ) is now shaped like this: { "ok": true, "rows": [ { "id": 3, "name": "Detroit" }, { "id": 2, "name": "Los Angeles" }, { "id": 4, "name": "Memnonia" }, { "id": 1, "name": "San Francisco" } ], "truncated": false } Tables will include an additional "next" key for pagination, which can be passed to ?_next= to fetch the next page of results. The various ?_shape= options continue to work as before - see Different shapes for details. A new ?_extra= mechanism is available for tables, but has not yet been stabilized or documented. Details on that are available in #262 . ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/782", "label": "#782"}, {"href": "https://github.com/simonw/datasette/issues/262", "label": "#262"}]
changelog:smaller-changes changelog smaller-changes Smaller changes Datasette documentation now shows YAML examples for Metadata by default, with a tab interface for switching to JSON. ( #1153 ) register_output_renderer(datasette) plugins now have access to error and truncated arguments, allowing them to display error messages and take into account truncated results. ( #2130 ) render_cell() plugin hook now also supports an optional request argument. ( #2007 ) New Justfile to support development workflows for Datasette using Just . datasette.render_template() can now accepts a datasette.views.Context subclass as an alternative to a dictionary. ( #2127 ) datasette install -e path option for editable installations, useful while developing plugins. ( #2106 ) When started with the --cors option Datasette now serves an Access-Control-Max-Age: 3600 header, ensuring CORS OPTIONS requests are repeated no more than once an hour. ( #2079 ) Fixed a bug where the _internal database could display None instead of null for in-memory databases. ( #1970 ) ["Changelog", "1.0a3 (2023-08-09)"] [{"href": "https://github.com/simonw/datasette/issues/1153", "label": "#1153"}, {"href": "https://github.com/simonw/datasette/issues/2130", "label": "#2130"}, {"href": "https://github.com/simonw/datasette/issues/2007", "label": "#2007"}, {"href": "https://github.com/casey/just", "label": "Just"}, {"href": "https://github.com/simonw/datasette/issues/2127", "label": "#2127"}, {"href": "https://github.com/simonw/datasette/issues/2106", "label": "#2106"}, {"href": "https://github.com/simonw/datasette/issues/2079", "label": "#2079"}, {"href": "https://github.com/simonw/datasette/issues/1970", "label": "#1970"}]
changelog:id9 changelog id9 0.64.2 (2023-03-08) Fixed a bug with datasette publish cloudrun where deploys all used the same Docker image tag. This was mostly inconsequential as the service is deployed as soon as the image has been pushed to the registry, but could result in the incorrect image being deployed if two different deploys for two separate services ran at exactly the same time. ( #2036 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/2036", "label": "#2036"}]
changelog:id10 changelog id10 0.64.1 (2023-01-11) Documentation now links to a current source of information for installing Python 3. ( #1987 ) Incorrectly calling the Datasette constructor using Datasette("path/to/data.db") instead of Datasette(["path/to/data.db"]) now returns a useful error message. ( #1985 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1987", "label": "#1987"}, {"href": "https://github.com/simonw/datasette/issues/1985", "label": "#1985"}]
changelog:id11 changelog id11 0.64 (2023-01-09) Datasette now strongly recommends against allowing arbitrary SQL queries if you are using SpatiaLite . SpatiaLite includes SQL functions that could cause the Datasette server to crash. See SpatiaLite for more details. New default_allow_sql setting, providing an easier way to disable all arbitrary SQL execution by end users: datasette --setting default_allow_sql off . See also Controlling the ability to execute arbitrary SQL . ( #1409 ) Building a location to time zone API with SpatiaLite is a new Datasette tutorial showing how to safely use SpatiaLite to create a location to time zone API. New documentation about how to debug problems loading SQLite extensions . The error message shown when an extension cannot be loaded has also been improved. ( #1979 ) Fixed an accessibility issue: the <select> elements in the table filter form now show an outline when they are currently focused. ( #1771 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1409", "label": "#1409"}, {"href": "https://datasette.io/tutorials/spatialite", "label": "Building a location to time zone API with SpatiaLite"}, {"href": "https://github.com/simonw/datasette/issues/1979", "label": "#1979"}, {"href": "https://github.com/simonw/datasette/issues/1771", "label": "#1771"}]
changelog:id12 changelog id12 0.63.3 (2022-12-17) Fixed a bug where datasette --root , when running in Docker, would only output the URL to sign in root when the server shut down, not when it started up. ( #1958 ) You no longer need to ensure await datasette.invoke_startup() has been called in order for Datasette to start correctly serving requests - this is now handled automatically the first time the server receives a request. This fixes a bug experienced when Datasette is served directly by an ASGI application server such as Uvicorn or Gunicorn. It also fixes a bug with the datasette-gunicorn plugin. ( #1955 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1958", "label": "#1958"}, {"href": "https://datasette.io/plugins/datasette-gunicorn", "label": "datasette-gunicorn"}, {"href": "https://github.com/simonw/datasette/issues/1955", "label": "#1955"}]
changelog:v1-0-a2 changelog v1-0-a2 1.0a2 (2022-12-14) The third Datasette 1.0 alpha release adds upsert support to the JSON API, plus the ability to specify finely grained permissions when creating an API token. See Datasette 1.0a2: Upserts and finely grained permissions for an extended, annotated version of these release notes. New /db/table/-/upsert API, documented here . upsert is an update-or-insert: existing rows will have specified keys updated, but if no row matches the incoming primary key a brand new row will be inserted instead. ( #1878 ) New register_permissions(datasette) plugin hook. Plugins can now register named permissions, which will then be listed in various interfaces that show available permissions. ( #1940 ) The /db/-/create API for creating a table now accepts "ignore": true and "replace": true options when called with the "rows" property that creates a new table based on an example set of rows. This means the API can be called multiple times with different rows, setting rules for what should happen if a primary key collides with an existing row. ( #1927 ) Arbitrary permissions can now be configured at the instance, database and resource (table, SQL view or canned query) level in Datasette's Metadata JSON and YAML files. The new "permissions" key can be used to specify which actors should have which permissions. See Other permissions in datasette.yaml for details. ( #1636 ) The /-/create-token page can now be used to create API tokens which are restricted to just a subset of actions, including against specific databases or resources. See API Tokens for details. ( #1947 ) Likewise, the datasette create-token CLI command can now create tokens with a subset of permis… ["Changelog"] [{"href": "https://simonwillison.net/2022/Dec/15/datasette-1a2/", "label": "Datasette 1.0a2: Upserts and finely grained permissions"}, {"href": "https://github.com/simonw/datasette/issues/1878", "label": "#1878"}, {"href": "https://github.com/simonw/datasette/issues/1940", "label": "#1940"}, {"href": "https://github.com/simonw/datasette/issues/1927", "label": "#1927"}, {"href": "https://github.com/simonw/datasette/issues/1636", "label": "#1636"}, {"href": "https://github.com/simonw/datasette/issues/1947", "label": "#1947"}, {"href": "https://github.com/simonw/datasette/issues/1855", "label": "#1855"}, {"href": "https://github.com/simonw/datasette/issues/1951", "label": "#1951"}, {"href": "https://github.com/simonw/datasette/issues/1937", "label": "#1937"}]
changelog:v1-0-a1 changelog v1-0-a1 1.0a1 (2022-12-01) Write APIs now serve correct CORS headers if Datasette is started in --cors mode. See the full list of CORS headers in the documentation. ( #1922 ) Fixed a bug where the _memory database could be written to even though writes were not persisted. ( #1917 ) The https://latest.datasette.io/ demo instance now includes an ephemeral database which can be used to test Datasette's write APIs, using the new datasette-ephemeral-tables plugin to drop any created tables after five minutes. This database is only available if you sign in as the root user using the link on the homepage. ( #1915 ) Fixed a bug where hitting the write endpoints with a GET request returned a 500 error. It now returns a 405 (method not allowed) error instead. ( #1916 ) The list of endpoints in the API explorer now lists mutable databases first. ( #1918 ) The "ignore": true and "replace": true options for the insert API are now documented . ( #1924 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1922", "label": "#1922"}, {"href": "https://github.com/simonw/datasette/issues/1917", "label": "#1917"}, {"href": "https://latest.datasette.io/", "label": "https://latest.datasette.io/"}, {"href": "https://datasette.io/plugins/datasette-ephemeral-tables", "label": "datasette-ephemeral-tables"}, {"href": "https://github.com/simonw/datasette/issues/1915", "label": "#1915"}, {"href": "https://github.com/simonw/datasette/issues/1916", "label": "#1916"}, {"href": "https://github.com/simonw/datasette/issues/1918", "label": "#1918"}, {"href": "https://github.com/simonw/datasette/issues/1924", "label": "#1924"}]
changelog:v1-0-a0 changelog v1-0-a0 1.0a0 (2022-11-29) This first alpha release of Datasette 1.0 introduces a brand new collection of APIs for writing to the database ( #1850 ), as well as a new API token mechanism baked into Datasette core. Previously, API tokens have only been supported by installing additional plugins. This is very much a preview: expect many more backwards incompatible API changes prior to the full 1.0 release. Feedback enthusiastically welcomed, either through issue comments or via the Datasette Discord community. ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1850", "label": "#1850"}, {"href": "https://github.com/simonw/datasette/issues/1850", "label": "issue comments"}, {"href": "https://datasette.io/discord", "label": "Datasette Discord"}]
changelog:signed-api-tokens changelog signed-api-tokens Signed API tokens New /-/create-token page allowing authenticated users to create signed API tokens that can act on their behalf, see API Tokens . ( #1852 ) New datasette create-token command for creating tokens from the command line: datasette create-token . New allow_signed_tokens setting which can be used to turn off signed token support. ( #1856 ) New max_signed_tokens_ttl setting for restricting the maximum allowed duration of a signed token. ( #1858 ) ["Changelog", "1.0a0 (2022-11-29)"] [{"href": "https://github.com/simonw/datasette/issues/1852", "label": "#1852"}, {"href": "https://github.com/simonw/datasette/issues/1856", "label": "#1856"}, {"href": "https://github.com/simonw/datasette/issues/1858", "label": "#1858"}]
changelog:write-api changelog write-api Write API New API explorer at /-/api for trying out the API. ( #1871 ) /db/-/create API for Creating a table . ( #1882 ) /db/table/-/insert API for Inserting rows . ( #1851 ) /db/table/-/drop API for Dropping tables . ( #1874 ) /db/table/pk/-/update API for Updating a row . ( #1863 ) /db/table/pk/-/delete API for Deleting a row . ( #1864 ) ["Changelog", "1.0a0 (2022-11-29)"] [{"href": "https://github.com/simonw/datasette/issues/1871", "label": "#1871"}, {"href": "https://github.com/simonw/datasette/issues/1882", "label": "#1882"}, {"href": "https://github.com/simonw/datasette/issues/1851", "label": "#1851"}, {"href": "https://github.com/simonw/datasette/issues/1874", "label": "#1874"}, {"href": "https://github.com/simonw/datasette/issues/1863", "label": "#1863"}, {"href": "https://github.com/simonw/datasette/issues/1864", "label": "#1864"}]
changelog:id13 changelog id13 0.63.2 (2022-11-18) Fixed a bug in datasette publish heroku where deployments failed due to an older version of Python being requested. ( #1905 ) New datasette publish heroku --generate-dir <dir> option for generating a Heroku deployment directory without deploying it. ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1905", "label": "#1905"}]
changelog:id14 changelog id14 0.63.1 (2022-11-10) Fixed a bug where Datasette's table filter form would not redirect correctly when run behind a proxy using the base_url setting. ( #1883 ) SQL query is now shown wrapped in a <textarea> if a query exceeds a time limit. ( #1876 ) Fixed an intermittent "Too many open files" error while running the test suite. ( #1843 ) New db.close() internal method. ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1883", "label": "#1883"}, {"href": "https://github.com/simonw/datasette/issues/1876", "label": "#1876"}, {"href": "https://github.com/simonw/datasette/issues/1843", "label": "#1843"}]
changelog:id15 changelog id15 0.63 (2022-10-27) See Datasette 0.63: The annotated release notes for more background on the changes in this release. ["Changelog"] [{"href": "https://simonwillison.net/2022/Oct/27/datasette-0-63/", "label": "Datasette 0.63: The annotated release notes"}]
changelog:features changelog features Features Now tested against Python 3.11. Docker containers used by datasette publish and datasette package both now use that version of Python. ( #1853 ) --load-extension option now supports entrypoints. Thanks, Alex Garcia. ( #1789 ) Facet size can now be set per-table with the new facet_size table metadata option. ( #1804 ) The truncate_cells_html setting now also affects long URLs in columns. ( #1805 ) The non-JavaScript SQL editor textarea now increases height to fit the SQL query. ( #1786 ) Facets are now displayed with better line-breaks in long values. Thanks, Daniel Rech. ( #1794 ) The settings.json file used in Configuration directory mode is now validated on startup. ( #1816 ) SQL queries can now include leading SQL comments, using /* ... */ or -- ... syntax. Thanks, Charles Nepote. ( #1860 ) SQL query is now re-displayed when terminated with a time limit error. ( #1819 ) The inspect data mechanism is now used to speed up server startup - thanks, Forest Gregg. ( #1834 ) In Configuration directory mode databases with filenames ending in .sqlite or .sqlite3 are now automatically added to the Datasette instance. ( #1646 ) Breadcrumb navigation display now respects the current user's permissions. ( #1831 ) ["Changelog", "0.63 (2022-10-27)"] [{"href": "https://github.com/simonw/datasette/issues/1853", "label": "#1853"}, {"href": "https://github.com/simonw/datasette/pull/1789", "label": "#1789"}, {"href": "https://github.com/simonw/datasette/issues/1804", "label": "#1804"}, {"href": "https://github.com/simonw/datasette/issues/1805", "label": "#1805"}, {"href": "https://github.com/simonw/datasette/issues/1786", "label": "#1786"}, {"href": "https://github.com/simonw/datasette/pull/1794", "label": "#1794"}, {"href": "https://github.com/simonw/datasette/issues/1816", "label": "#1816"}, {"href": "https://github.com/simonw/datasette/issues/1860", "label": "#1860"}, {"href": "https://github.com/simonw/datasette/issues/1819", "label": "#1819"}, {"href": "https://github.com/simonw/datasette/issues/1834", "label": "#1834"}, {"href": "https://github.com/simonw/datasette/issues/1646", "label": "#1646"}, {"href": "https://github.com/simonw/datasette/issues/1831", "label": "#1831"}]
changelog:plugin-hooks-and-internals changelog plugin-hooks-and-internals Plugin hooks and internals The prepare_jinja2_environment(env, datasette) plugin hook now accepts an optional datasette argument. Hook implementations can also now return an async function which will be awaited automatically. ( #1809 ) Database(is_mutable=) now defaults to True . ( #1808 ) The datasette.check_visibility() method now accepts an optional permissions= list, allowing it to take multiple permissions into account at once when deciding if something should be shown as public or private. This has been used to correctly display padlock icons in more places in the Datasette interface. ( #1829 ) Datasette no longer enforces upper bounds on its dependencies. ( #1800 ) ["Changelog", "0.63 (2022-10-27)"] [{"href": "https://github.com/simonw/datasette/issues/1809", "label": "#1809"}, {"href": "https://github.com/simonw/datasette/issues/1808", "label": "#1808"}, {"href": "https://github.com/simonw/datasette/issues/1829", "label": "#1829"}, {"href": "https://github.com/simonw/datasette/issues/1800", "label": "#1800"}]
changelog:id16 changelog id16 Documentation New tutorial: Cleaning data with sqlite-utils and Datasette . Screenshots in the documentation are now maintained using shot-scraper , as described in Automating screenshots for the Datasette documentation using shot-scraper . ( #1844 ) More detailed command descriptions on the CLI reference page. ( #1787 ) New documentation on Running Datasette using OpenRC - thanks, Adam Simpson. ( #1825 ) ["Changelog", "0.63 (2022-10-27)"] [{"href": "https://datasette.io/tutorials/clean-data", "label": "Cleaning data with sqlite-utils and Datasette"}, {"href": "https://shot-scraper.datasette.io/", "label": "shot-scraper"}, {"href": "https://simonwillison.net/2022/Oct/14/automating-screenshots/", "label": "Automating screenshots for the Datasette documentation using shot-scraper"}, {"href": "https://github.com/simonw/datasette/issues/1844", "label": "#1844"}, {"href": "https://github.com/simonw/datasette/issues/1787", "label": "#1787"}, {"href": "https://github.com/simonw/datasette/pull/1825", "label": "#1825"}]
changelog:id17 changelog id17 0.62 (2022-08-14) Datasette can now run entirely in your browser using WebAssembly. Try out Datasette Lite , take a look at the code or read more about it in Datasette Lite: a server-side Python web application running in a browser . Datasette now has a Discord community for questions and discussions about Datasette and its ecosystem of projects. ["Changelog"] [{"href": "https://lite.datasette.io/", "label": "Datasette Lite"}, {"href": "https://github.com/simonw/datasette-lite", "label": "at the code"}, {"href": "https://simonwillison.net/2022/May/4/datasette-lite/", "label": "Datasette Lite: a server-side Python web application running in a browser"}, {"href": "https://datasette.io/discord", "label": "Discord community"}]
changelog:id18 changelog id18 Features Datasette is now compatible with Pyodide . This is the enabling technology behind Datasette Lite . ( #1733 ) Database file downloads now implement conditional GET using ETags. ( #1739 ) HTML for facet results and suggested results has been extracted out into new templates _facet_results.html and _suggested_facets.html . Thanks, M. Nasimul Haque. ( #1759 ) Datasette now runs some SQL queries in parallel. This has limited impact on performance, see this research issue for details. New --nolock option for ignoring file locks when opening read-only databases. ( #1744 ) Spaces in the database names in URLs are now encoded as + rather than ~20 . ( #1701 ) <Binary: 2427344 bytes> is now displayed as <Binary: 2,427,344 bytes> and is accompanied by tooltip showing "2.3MB". ( #1712 ) The base Docker image used by datasette publish cloudrun , datasette package and the official Datasette image has been upgraded to 3.10.6-slim-bullseye . ( #1768 ) Canned writable queries against immutable databases now show a warning message. ( #1728 ) datasette publish cloudrun has a new --timeout option which can be used to increase the time limit applied by the Google Cloud build environment. Thanks, Tim Sherratt. ( #1717 ) datasette publish cloudrun has new --min-instances and --max-instances options. ( #1779 ) ["Changelog", "0.62 (2022-08-14)"] [{"href": "https://pyodide.org/", "label": "Pyodide"}, {"href": "https://lite.datasette.io/", "label": "Datasette Lite"}, {"href": "https://github.com/simonw/datasette/issues/1733", "label": "#1733"}, {"href": "https://github.com/simonw/datasette/issues/1739", "label": "#1739"}, {"href": "https://github.com/simonw/datasette/pull/1759", "label": "#1759"}, {"href": "https://github.com/simonw/datasette/issues/1727", "label": "this research issue"}, {"href": "https://github.com/simonw/datasette/issues/1744", "label": "#1744"}, {"href": "https://github.com/simonw/datasette/issues/1701", "label": "#1701"}, {"href": "https://github.com/simonw/datasette/issues/1712", "label": "#1712"}, {"href": "https://hub.docker.com/datasetteproject/datasette", "label": "official Datasette image"}, {"href": "https://github.com/simonw/datasette/issues/1768", "label": "#1768"}, {"href": "https://github.com/simonw/datasette/issues/1728", "label": "#1728"}, {"href": "https://github.com/simonw/datasette/pull/1717", "label": "#1717"}, {"href": "https://github.com/simonw/datasette/issues/1779", "label": "#1779"}]
changelog:id19 changelog id19 Plugin hooks New plugin hook: handle_exception() , for custom handling of exceptions caught by Datasette. ( #1770 ) The render_cell() plugin hook is now also passed a row argument, representing the sqlite3.Row object that is being rendered. ( #1300 ) The configuration directory is now stored in datasette.config_dir , making it available to plugins. Thanks, Chris Amico. ( #1766 ) ["Changelog", "0.62 (2022-08-14)"] [{"href": "https://github.com/simonw/datasette/issues/1770", "label": "#1770"}, {"href": "https://github.com/simonw/datasette/issues/1300", "label": "#1300"}, {"href": "https://github.com/simonw/datasette/pull/1766", "label": "#1766"}]
changelog:bug-fixes changelog bug-fixes Bug fixes Don't show the facet option in the cog menu if faceting is not allowed. ( #1683 ) ?_sort and ?_sort_desc now work if the column that is being sorted has been excluded from the query using ?_col= or ?_nocol= . ( #1773 ) Fixed bug where ?_sort_desc was duplicated in the URL every time the Apply button was clicked. ( #1738 ) ["Changelog", "0.62 (2022-08-14)"] [{"href": "https://github.com/simonw/datasette/issues/1683", "label": "#1683"}, {"href": "https://github.com/simonw/datasette/issues/1773", "label": "#1773"}, {"href": "https://github.com/simonw/datasette/issues/1738", "label": "#1738"}]
changelog:id20 changelog id20 Documentation Examples in the documentation now include a copy-to-clipboard button. ( #1748 ) Documentation now uses the Furo Sphinx theme. ( #1746 ) Code examples in the documentation are now all formatted using Black. ( #1718 ) Request.fake() method is now documented, see Request object . New documentation for plugin authors: Registering a plugin for the duration of a test . ( #903 ) ["Changelog", "0.62 (2022-08-14)"] [{"href": "https://github.com/simonw/datasette/issues/1748", "label": "#1748"}, {"href": "https://github.com/pradyunsg/furo", "label": "Furo"}, {"href": "https://github.com/simonw/datasette/issues/1746", "label": "#1746"}, {"href": "https://github.com/simonw/datasette/issues/1718", "label": "#1718"}, {"href": "https://github.com/simonw/datasette/issues/903", "label": "#903"}]
changelog:id21 changelog id21 0.61.1 (2022-03-23) Fixed a bug where databases with a different route from their name (as used by the datasette-hashed-urls plugin ) returned errors when executing custom SQL queries. ( #1682 ) ["Changelog"] [{"href": "https://datasette.io/plugins/datasette-hashed-urls", "label": "datasette-hashed-urls plugin"}, {"href": "https://github.com/simonw/datasette/issues/1682", "label": "#1682"}]
changelog:id22 changelog id22 0.61 (2022-03-23) In preparation for Datasette 1.0, this release includes two potentially backwards-incompatible changes. Hashed URL mode has been moved to a separate plugin, and the way Datasette generates URLs to databases and tables with special characters in their name such as / and . has changed. Datasette also now requires Python 3.7 or higher. URLs within Datasette now use a different encoding scheme for tables or databases that include "special" characters outside of the range of a-zA-Z0-9_- . This scheme is explained here: Tilde encoding . ( #1657 ) Removed hashed URL mode from Datasette. The new datasette-hashed-urls plugin can be used to achieve the same result, see datasette-hashed-urls for details. ( #1661 ) Databases can now have a custom path within the Datasette instance that is independent of the database name, using the db.route property. ( #1668 ) Datasette is now covered by a Code of Conduct . ( #1654 ) Python 3.6 is no longer supported. ( #1577 ) Tests now run against Python 3.11-dev. ( #1621 ) New datasette.ensure_permissions(actor, permissions) internal method for checking multiple permissions at once. ( #1675 ) New datasette.check_visibility(actor, action, resource=None) internal method for checking if a user can see a resource that would otherwise be invisible to unauthenticated users. ( #1678 ) Table and row HTML pages now include a <link rel="alternate" type="application/json+datasette" href="..."> element and return a Link: URL; rel="alternate"; type="applicatio… ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1657", "label": "#1657"}, {"href": "https://github.com/simonw/datasette/issues/1661", "label": "#1661"}, {"href": "https://github.com/simonw/datasette/issues/1668", "label": "#1668"}, {"href": "https://github.com/simonw/datasette/blob/main/CODE_OF_CONDUCT.md", "label": "Code of Conduct"}, {"href": "https://github.com/simonw/datasette/issues/1654", "label": "#1654"}, {"href": "https://github.com/simonw/datasette/issues/1577", "label": "#1577"}, {"href": "https://github.com/simonw/datasette/issues/1621", "label": "#1621"}, {"href": "https://github.com/simonw/datasette/issues/1675", "label": "#1675"}, {"href": "https://github.com/simonw/datasette/issues/1678", "label": "#1678"}, {"href": "https://github.com/simonw/datasette/issues/1533", "label": "#1533"}, {"href": "https://github.com/simonw/datasette/issues/1612", "label": "#1612"}, {"href": "https://github.com/simonw/datasette/issues/1603", "label": "#1603"}, {"href": "https://github.com/simonw/datasette/issues/1587", "label": "#1587"}, {"href": "https://github.com/simonw/datasette/issues/1601", "label": "#1601"}, {"href": "https://github.com/simonw/datasette/issues/1576", "label": "#1576"}, {"href": "https://github.com/simonw/datasette/issues/957", "label": "#957"}, {"href": "https://github.com/simonw/datasette/issues/1607", "label": "#1607"}, {"href": "https://datasette.io/tutorials", "label": "Datasette Tutorials"}, {"href": "https://github.com/simonw/datasette/pull/1649", "label": "#1649"}, {"href": "https://github.com/simonw/datasette/issues/1545", "label": "#1545"}, {"href": "https://github.com/simonw/datasette/issues/1228", "label": "#1228"}]
changelog:id23 changelog id23 0.60.2 (2022-02-07) Fixed a bug where Datasette would open the same file twice with two different database names if you ran datasette file.db file.db . ( #1632 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1632", "label": "#1632"}]
changelog:id24 changelog id24 0.60.1 (2022-01-20) Fixed a bug where installation on Python 3.6 stopped working due to a change to an underlying dependency. This release can now be installed on Python 3.6, but is the last release of Datasette that will support anything less than Python 3.7. ( #1609 ) ["Changelog"] [{"href": "https://github.com/simonw/datasette/issues/1609", "label": "#1609"}]

Next page

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [sections] (
   [id] TEXT PRIMARY KEY,
   [page] TEXT,
   [ref] TEXT,
   [title] TEXT,
   [content] TEXT,
   [breadcrumbs] TEXT,
   [references] TEXT
);
Powered by Datasette · Queries took 1.2ms