.. _changelog: ========= 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. - New ``/db/table/-/upsert`` API, :ref:`documented here `. upsert is an update-or-replace: existing rows will have specified keys updated, but if no row matches the incoming primary key a brand new row will be inserted instead. (:issue:`1878`) - New :ref:`plugin_register_permissions` plugin hook. Plugins can now register named permissions, which will then be listed in various interfaces that show available permissions. (:issue:`1940`) - The ``/db/-/create`` API for :ref:`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. (:issue:`1927`) - Arbitrary permissions can now be configured at the instance, database and resource (table, SQL view or canned query) level in Datasette's :ref:`metadata` JSON and YAML files. The new ``"permissions"`` key can be used to specify which actors should have which permissions. See :ref:`authentication_permissions_other` for details. (:issue:`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 :ref:`CreateTokenView` for details. (:issue:`1947`) - Likewise, the ``datasette create-token`` CLI command can now create tokens with :ref:`a subset of permissions `. (:issue:`1855`) - New :ref:`datasette.create_token() API method `` for programmatically creating signed API tokens. (:issue:`1951`) - ``/db//-/create`` API now requires actor to have ``insert-row`` permission in order to use the ``"row"`` or ``"rows"`` properties. (:issue:`1937`) .. _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 :ref:`CORS headers ` in the documentation. (:issue:`1922`) - Fixed a bug where the ``_memory`` database could be written to even though writes were not persisted. (:issue:`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. (:issue:`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. (:issue:`1916`) - The list of endpoints in the API explorer now lists mutable databases first. (:issue:`1918`) - The ``"ignore": true`` and ``"replace": true`` options for the insert API are :ref:`now documented `. (:issue:`1924`) .. _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 (:issue:`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. Signed API tokens ~~~~~~~~~~~~~~~~~ - New ``/-/create-token`` page allowing authenticated users to create signed API tokens that can act on their behalf, see :ref:`CreateTokenView`. (:issue:`1852`) - New ``datasette create-token`` command for creating tokens from the command line: :ref:`authentication_cli_create_token`. - New :ref:`setting_allow_signed_tokens` setting which can be used to turn off signed token support. (:issue:`1856`) - New :ref:`setting_max_signed_tokens_ttl` setting for restricting the maximum allowed duration of a signed token. (:issue:`1858`) Write API ~~~~~~~~~ - New API explorer at ``/-/api`` for trying out the API. (:issue:`1871`) - ``/db/-/create`` API for :ref:`TableCreateView`. (:issue:`1882`) - ``/db/table/-/insert`` API for :ref:`TableInsertView`. (:issue:`1851`) - ``/db/table/-/drop`` API for :ref:`TableDropView`. (:issue:`1874`) - ``/db/table/pk/-/update`` API for :ref:`RowUpdateView`. (:issue:`1863`) - ``/db/table/pk/-/delete`` API for :ref:`RowDeleteView`. (:issue:`1864`) .. _v0_63_2: 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. (:issue:`1905`) - New ``datasette publish heroku --generate-dir `` option for generating a Heroku deployment directory without deploying it. .. _v0_63_1: 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 :ref:`base_url ` setting. (:issue:`1883`) - SQL query is now shown wrapped in a ``