{"id": "changelog:permission-checks-now-consider-opinions-from-every-plugin", "page": "changelog", "ref": "permission-checks-now-consider-opinions-from-every-plugin", "title": "Permission checks now consider opinions from every plugin", "content": "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 ) \n 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 . \n This is explained at length in the new documentation covering How permissions are resolved .", "breadcrumbs": "[\"Changelog\", \"1.0a9 (2024-02-16)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/2275\", \"label\": \"#2275\"}]"} {"id": "changelog:v1-0-a10", "page": "changelog", "ref": "v1-0-a10", "title": "1.0a10 (2024-02-17)", "content": "The only changes in this alpha correspond to the way Datasette handles database transactions. ( #2277 ) \n \n \n 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. \n \n \n Pass transaction=False to execute_write_fn() if you want to manually handle transactions in your function. \n \n \n 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.", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/2277\", \"label\": \"#2277\"}]"} {"id": "changelog:v1-0-a11", "page": "changelog", "ref": "v1-0-a11", "title": "1.0a11 (2024-02-19)", "content": "The \"replace\": true argument to the /db/table/-/insert API now requires the actor to have the update-row permission. ( #2279 ) \n \n \n Fixed some UI bugs in the interactive permissions debugging tool. ( #2278 ) \n \n \n The column action menu now aligns better with the cog icon, and positions itself taking into account the width of the browser window. ( #2263 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"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\"}]"} {"id": "changelog:v1-0-a12", "page": "changelog", "ref": "v1-0-a12", "title": "1.0a12 (2024-02-29)", "content": "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 ) \n \n \n New design for the button that opens the query, table and database actions menu. ( #2281 ) \n \n \n \"does not contain\" table filter for finding rows that do not contain a string. ( #2287 ) \n \n \n Fixed a bug in the makeColumnActions(columnDetails) JavaScript plugin mechanism where the column action menu was not fully reset in between each interaction. ( #2289 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"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\"}]"} {"id": "changelog:v1-0-a13", "page": "changelog", "ref": "v1-0-a13", "title": "1.0a13 (2024-03-12)", "content": "Each of the key concepts in Datasette now has an actions menu , which plugins can use to add additional functionality targeting that entity. \n \n \n Plugin hook: view_actions() for actions that can be applied to a SQL view. ( #2297 ) \n \n \n Plugin hook: homepage_actions() for actions that apply to the instance homepage. ( #2298 ) \n \n \n Plugin hook: row_actions() for actions that apply to the row page. ( #2299 ) \n \n \n 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 ) \n \n \n Plugin hooks documentation page is now organized with additional headings. ( #2300 ) \n \n \n Improved the display of action buttons on pages that also display metadata. ( #2286 ) \n \n \n The header and footer of the page now uses a subtle gradient effect, and options in the navigation menu are better visually defined. ( #2302 ) \n \n \n Table names that start with an underscore now default to hidden. ( #2104 ) \n \n \n 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 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"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\"}]"} {"id": "changelog:id123", "page": "changelog", "ref": "id123", "title": "0.21 (2018-05-05)", "content": "New JSON _shape= options, the ability to set table _size= and a mechanism for searching within specific columns. \n \n \n Default tests to using a longer timelimit \n Every now and then a test will fail in Travis CI on Python 3.5 because it hit\n the default 20ms SQL time limit. \n Test fixtures now default to a 200ms time limit, and we only use the 20ms time\n limit for the specific test that tests query interruption. This should make\n our tests on Python 3.5 in Travis much more stable. \n \n \n Support _search_COLUMN=text searches, closes #237 \n \n \n Show version on /-/plugins page, closes #248 \n \n \n ?_size=max option, closes #249 \n \n \n Added /-/versions and /-/versions.json , closes #244 \n Sample output: \n {\n \"python\": {\n \"version\": \"3.6.3\",\n \"full\": \"3.6.3 (default, Oct 4 2017, 06:09:38) \\n[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)]\"\n },\n \"datasette\": {\n \"version\": \"0.20\"\n },\n \"sqlite\": {\n \"version\": \"3.23.1\",\n \"extensions\": {\n \"json1\": null,\n \"spatialite\": \"4.3.0a\"\n }\n }\n} \n \n \n Renamed ?_sql_time_limit_ms= to ?_timelimit , closes #242 \n \n \n New ?_shape=array option + tweaks to _shape , closes #245 \n \n \n Default is now ?_shape=arrays (renamed from lists ) \n \n \n New ?_shape=array returns an array of objects as the root object \n \n \n Changed ?_shape=object to return the object as the root \n \n \n Updated docs \n \n \n \n \n FTS tables now detected by inspect() , closes #240 \n \n \n New ?_size=XXX query string parameter for table view, closes #229 \n Also added documentation for all of the _special arguments. \n Plus deleted some duplicate logic implementing _group_count . \n \n \n If max_returned_rows==page_size , increment max_returned_rows - fixes #230 \n \n \n New hidden: True option for table metadata, closes #239 \n \n \n Hide idx_* tables if spatialite detected, closes #228 \n \n \n Added class=rows-and-columns to custom query results table \n \n \n Added CSS class rows-and-columns to main table \n \n \n label_column option in metadata.json - closes #234", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/237\", \"label\": \"#237\"}, {\"href\": \"https://github.com/simonw/datasette/issues/248\", \"label\": \"#248\"}, {\"href\": \"https://github.com/simonw/datasette/issues/249\", \"label\": \"#249\"}, {\"href\": \"https://github.com/simonw/datasette/issues/244\", \"label\": \"#244\"}, {\"href\": \"https://github.com/simonw/datasette/issues/242\", \"label\": \"#242\"}, {\"href\": \"https://github.com/simonw/datasette/issues/245\", \"label\": \"#245\"}, {\"href\": \"https://github.com/simonw/datasette/issues/240\", \"label\": \"#240\"}, {\"href\": \"https://github.com/simonw/datasette/issues/229\", \"label\": \"#229\"}, {\"href\": \"https://github.com/simonw/datasette/issues/230\", \"label\": \"#230\"}, {\"href\": \"https://github.com/simonw/datasette/issues/239\", \"label\": \"#239\"}, {\"href\": \"https://github.com/simonw/datasette/issues/228\", \"label\": \"#228\"}, {\"href\": \"https://github.com/simonw/datasette/issues/234\", \"label\": \"#234\"}]"} {"id": "changelog:id33", "page": "changelog", "ref": "id33", "title": "0.55 (2021-02-18)", "content": "Support for cross-database SQL queries and built-in support for serving via HTTPS. \n \n \n The new --crossdb command-line option causes Datasette to attach up to ten database files to the same /_memory database connection. This enables cross-database SQL queries, including the ability to use joins and unions to combine data from tables that exist in different database files. See Cross-database queries for details. ( #283 ) \n \n \n --ssl-keyfile and --ssl-certfile options can be used to specify a TLS certificate, allowing Datasette to serve traffic over https:// without needing to run it behind a separate proxy. ( #1221 ) \n \n \n The /:memory: page has been renamed (and redirected) to /_memory for consistency with the new /_internal database introduced in Datasette 0.54. ( #1205 ) \n \n \n Added plugin testing documentation on Using pdb for errors thrown inside Datasette . ( #1207 ) \n \n \n The official Datasette Docker image now uses Python 3.7.10, applying the latest security fix for that Python version. ( #1235 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/283\", \"label\": \"#283\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1221\", \"label\": \"#1221\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1205\", \"label\": \"#1205\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1207\", \"label\": \"#1207\"}, {\"href\": \"https://hub.docker.com/r/datasetteproject/datasette\", \"label\": \"official Datasette Docker image\"}, {\"href\": \"https://www.python.org/downloads/release/python-3710/\", \"label\": \"the latest security fix\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1235\", \"label\": \"#1235\"}]"} {"id": "changelog:id107", "page": "changelog", "ref": "id107", "title": "0.23.1 (2018-06-21)", "content": "Minor bugfix release. \n \n \n Correctly display empty strings in HTML table, closes #314 \n \n \n Allow \".\" in database filenames, closes #302 \n \n \n 404s ending in slash redirect to remove that slash, closes #309 \n \n \n Fixed incorrect display of compound primary keys with foreign key\n references. Closes #319 \n \n \n Docs + example of canned SQL query using || concatenation. Closes #321 \n \n \n Correctly display facets with value of 0 - closes #318 \n \n \n Default 'expand labels' to checked in CSV advanced export", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/314\", \"label\": \"#314\"}, {\"href\": \"https://github.com/simonw/datasette/issues/302\", \"label\": \"#302\"}, {\"href\": \"https://github.com/simonw/datasette/issues/309\", \"label\": \"#309\"}, {\"href\": \"https://github.com/simonw/datasette/issues/319\", \"label\": \"#319\"}, {\"href\": \"https://github.com/simonw/datasette/issues/321\", \"label\": \"#321\"}, {\"href\": \"https://github.com/simonw/datasette/issues/318\", \"label\": \"#318\"}]"} {"id": "changelog:id103", "page": "changelog", "ref": "id103", "title": "0.23.2 (2018-07-07)", "content": "Minor bugfix and documentation release. \n \n \n CSV export now respects --cors , fixes #326 \n \n \n Installation instructions , including docker image - closes #328 \n \n \n Fix for row pages for tables with / in, closes #325", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/326\", \"label\": \"#326\"}, {\"href\": \"https://github.com/simonw/datasette/issues/328\", \"label\": \"#328\"}, {\"href\": \"https://github.com/simonw/datasette/issues/325\", \"label\": \"#325\"}]"} {"id": "changelog:id94", "page": "changelog", "ref": "id94", "title": "0.24 (2018-07-23)", "content": "A number of small new features: \n \n \n datasette publish heroku now supports --extra-options , fixes #334 \n \n \n Custom error message if SpatiaLite is needed for specified database, closes #331 \n \n \n New config option: truncate_cells_html for truncating long cell values in HTML view - closes #330 \n \n \n Documentation for datasette publish and datasette package , closes #337 \n \n \n Fixed compatibility with Python 3.7 \n \n \n datasette publish heroku now supports app names via the -n option, which can also be used to overwrite an existing application [Russ Garrett] \n \n \n Title and description metadata can now be set for canned SQL queries , closes #342 \n \n \n New force_https_on config option, fixes https:// API URLs when deploying to Zeit Now - closes #333 \n \n \n ?_json_infinity=1 query string argument for handling Infinity/-Infinity values in JSON, closes #332 \n \n \n URLs displayed in the results of custom SQL queries are now URLified, closes #298", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/334\", \"label\": \"#334\"}, {\"href\": \"https://github.com/simonw/datasette/issues/331\", \"label\": \"#331\"}, {\"href\": \"https://github.com/simonw/datasette/issues/330\", \"label\": \"#330\"}, {\"href\": \"https://github.com/simonw/datasette/issues/337\", \"label\": \"#337\"}, {\"href\": \"https://github.com/simonw/datasette/issues/342\", \"label\": \"#342\"}, {\"href\": \"https://github.com/simonw/datasette/issues/333\", \"label\": \"#333\"}, {\"href\": \"https://github.com/simonw/datasette/issues/332\", \"label\": \"#332\"}, {\"href\": \"https://github.com/simonw/datasette/issues/298\", \"label\": \"#298\"}]"} {"id": "changelog:id93", "page": "changelog", "ref": "id93", "title": "0.25 (2018-09-19)", "content": "New plugin hooks, improved database view support and an easier way to use more recent versions of SQLite. \n \n \n New publish_subcommand plugin hook. A plugin can now add additional datasette publish publishers in addition to the default now and heroku , both of which have been refactored into default plugins. publish_subcommand documentation . Closes #349 \n \n \n New render_cell plugin hook. Plugins can now customize how values are displayed in the HTML tables produced by Datasette's browsable interface. datasette-json-html and datasette-render-images are two new plugins that use this hook. render_cell documentation . Closes #352 \n \n \n New extra_body_script plugin hook, enabling plugins to provide additional JavaScript that should be added to the page footer. extra_body_script documentation . \n \n \n extra_css_urls and extra_js_urls hooks now take additional optional parameters, allowing them to be more selective about which pages they apply to. Documentation . \n \n \n You can now use the sortable_columns metadata setting to explicitly enable sort-by-column in the interface for database views, as well as for specific tables. \n \n \n The new fts_table and fts_pk metadata settings can now be used to explicitly configure full-text search for a table or a view , even if that table is not directly coupled to the SQLite FTS feature in the database schema itself. \n \n \n Datasette will now use pysqlite3 in place of the standard library sqlite3 module if it has been installed in the current environment. This makes it much easier to run Datasette against a more recent version of SQLite, including the just-released SQLite 3.25.0 which adds window function support. More details on how to use this in #360 \n \n \n New mechanism that allows plugin configuration options to be set using metadata.json .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/349\", \"label\": \"#349\"}, {\"href\": \"https://github.com/simonw/datasette-json-html\", \"label\": \"datasette-json-html\"}, {\"href\": \"https://github.com/simonw/datasette-render-images\", \"label\": \"datasette-render-images\"}, {\"href\": \"https://github.com/simonw/datasette/issues/352\", \"label\": \"#352\"}, {\"href\": \"https://github.com/coleifer/pysqlite3\", \"label\": \"pysqlite3\"}, {\"href\": \"https://www.sqlite.org/releaselog/3_25_0.html\", \"label\": \"SQLite 3.25.0\"}, {\"href\": \"https://github.com/simonw/datasette/issues/360\", \"label\": \"#360\"}]"} {"id": "changelog:v0-28-faceting", "page": "changelog", "ref": "v0-28-faceting", "title": "Faceting improvements, and faceting plugins", "content": "Datasette Facets provide an intuitive way to quickly summarize and interact with data. Previously the only supported faceting technique was column faceting, but 0.28 introduces two powerful new capabilities: facet-by-JSON-array and the ability to define further facet types using plugins. \n Facet by array ( #359 ) is only available if your SQLite installation provides the json1 extension. Datasette will automatically detect columns that contain JSON arrays of values and offer a faceting interface against those columns - useful for modelling things like tags without needing to break them out into a new table. See Facet by JSON array for more. \n The new register_facet_classes() plugin hook ( #445 ) can be used to register additional custom facet classes. Each facet class should provide two methods: suggest() which suggests facet selections that might be appropriate for a provided SQL query, and facet_results() which executes a facet operation and returns results. Datasette's own faceting implementations have been refactored to use the same API as these plugins.", "breadcrumbs": "[\"Changelog\", \"0.28 (2019-05-19)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/359\", \"label\": \"#359\"}, {\"href\": \"https://github.com/simonw/datasette/pull/445\", \"label\": \"#445\"}]"} {"id": "changelog:id92", "page": "changelog", "ref": "id92", "title": "0.25.1 (2018-11-04)", "content": "Documentation improvements plus a fix for publishing to Zeit Now. \n \n \n datasette publish now now uses Zeit's v1 platform, to work around the new 100MB image limit. Thanks, @slygent - closes #366 .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/366\", \"label\": \"#366\"}]"} {"id": "changelog:id90", "page": "changelog", "ref": "id90", "title": "0.26 (2019-01-02)", "content": "datasette serve --reload now restarts Datasette if a database file changes on disk. \n \n \n datasette publish now now takes an optional --alias mysite.now.sh argument. This will attempt to set an alias after the deploy completes. \n \n \n Fixed a bug where the advanced CSV export form failed to include the currently selected filters ( #393 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/393\", \"label\": \"#393\"}]"} {"id": "changelog:id66", "page": "changelog", "ref": "id66", "title": "0.39 (2020-03-24)", "content": "New base_url configuration setting for serving up the correct links while running Datasette under a different URL prefix. ( #394 ) \n \n \n New metadata settings \"sort\" and \"sort_desc\" for setting the default sort order for a table. See Setting a default sort order . ( #702 ) \n \n \n Sort direction arrow now displays by default on the primary key. This means you only have to click once (not twice) to sort in reverse order. ( #677 ) \n \n \n New await Request(scope, receive).post_vars() method for accessing POST form variables. ( #700 ) \n \n \n Plugin hooks documentation now links to example uses of each plugin. ( #709 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/394\", \"label\": \"#394\"}, {\"href\": \"https://github.com/simonw/datasette/issues/702\", \"label\": \"#702\"}, {\"href\": \"https://github.com/simonw/datasette/issues/677\", \"label\": \"#677\"}, {\"href\": \"https://github.com/simonw/datasette/issues/700\", \"label\": \"#700\"}, {\"href\": \"https://github.com/simonw/datasette/issues/709\", \"label\": \"#709\"}]"} {"id": "changelog:id89", "page": "changelog", "ref": "id89", "title": "0.26.1 (2019-01-10)", "content": "/-/versions now includes SQLite compile_options ( #396 ) \n \n \n datasetteproject/datasette Docker image now uses SQLite 3.26.0 ( #397 ) \n \n \n Cleaned up some deprecation warnings under Python 3.7", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/396\", \"label\": \"#396\"}, {\"href\": \"https://hub.docker.com/r/datasetteproject/datasette\", \"label\": \"datasetteproject/datasette\"}, {\"href\": \"https://github.com/simonw/datasette/issues/397\", \"label\": \"#397\"}]"} {"id": "changelog:the-internal-database", "page": "changelog", "ref": "the-internal-database", "title": "The _internal database", "content": "As part of ongoing work to help Datasette handle much larger numbers of connected databases and tables (see Datasette Library ) Datasette now maintains an in-memory SQLite database with details of all of the attached databases, tables, columns, indexes and foreign keys. ( #1150 ) \n This will support future improvements such as a searchable, paginated homepage of all available tables. \n You can explore an example of this database by signing in as root to the latest.datasette.io demo instance and then navigating to latest.datasette.io/_internal . \n Plugins can use these tables to introspect attached data in an efficient way. Plugin authors should note that this is not yet considered a stable interface, so any plugins that use this may need to make changes prior to Datasette 1.0 if the _internal table schemas change.", "breadcrumbs": "[\"Changelog\", \"0.54 (2021-01-25)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/417\", \"label\": \"Datasette Library\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1150\", \"label\": \"#1150\"}, {\"href\": \"https://latest.datasette.io/login-as-root\", \"label\": \"signing in as root\"}, {\"href\": \"https://latest.datasette.io/_internal\", \"label\": \"latest.datasette.io/_internal\"}]"} {"id": "changelog:small-changes", "page": "changelog", "ref": "small-changes", "title": "Small changes", "content": "Databases published using datasette publish now open in Immutable mode . ( #469 ) \n \n \n ?col__date= now works for columns containing spaces \n \n \n Automatic label detection (for deciding which column to show when linking to a foreign key) has been improved. ( #485 ) \n \n \n Fixed bug where pagination broke when combined with an expanded foreign key. ( #489 ) \n \n \n Contributors can now run pip install -e .[docs] to get all of the dependencies needed to build the documentation, including cd docs && make livehtml support. \n \n \n Datasette's dependencies are now all specified using the ~= match operator. ( #532 ) \n \n \n white-space: pre-wrap now used for table creation SQL. ( #505 ) \n \n \n Full list of commits between 0.28 and 0.29.", "breadcrumbs": "[\"Changelog\", \"0.29 (2019-07-07)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/469\", \"label\": \"#469\"}, {\"href\": \"https://github.com/simonw/datasette/issues/485\", \"label\": \"#485\"}, {\"href\": \"https://github.com/simonw/datasette/issues/489\", \"label\": \"#489\"}, {\"href\": \"https://github.com/simonw/datasette/issues/532\", \"label\": \"#532\"}, {\"href\": \"https://github.com/simonw/datasette/issues/505\", \"label\": \"#505\"}, {\"href\": \"https://github.com/simonw/datasette/compare/0.28...0.29\", \"label\": \"Full list of commits\"}]"} {"id": "changelog:plugins-and-internals", "page": "changelog", "ref": "plugins-and-internals", "title": "Plugins and internals", "content": "New plugin hook: filters_from_request(request, database, table, datasette) , which runs on the table page and can be used to support new custom query string parameters that modify the SQL query. ( #473 ) \n \n \n Added two additional methods for writing to the database: await db.execute_write_script(sql, block=True) and await db.execute_write_many(sql, params_seq, block=True) . ( #1570 ) \n \n \n The db.execute_write() internal method now defaults to blocking until the write operation has completed. Previously it defaulted to queuing the write and then continuing to run code while the write was in the queue. ( #1579 ) \n \n \n Database write connections now execute the prepare_connection(conn, database, datasette) plugin hook. ( #1564 ) \n \n \n The Datasette() constructor no longer requires the files= argument, and is now documented at Datasette class . ( #1563 ) \n \n \n The tracing feature now traces write queries, not just read queries. ( #1568 ) \n \n \n The query string variables exposed by request.args will now include blank strings for arguments such as foo in ?foo=&bar=1 rather than ignoring those parameters entirely. ( #1551 )", "breadcrumbs": "[\"Changelog\", \"0.60 (2022-01-13)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/473\", \"label\": \"#473\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1570\", \"label\": \"#1570\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1579\", \"label\": \"#1579\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1564\", \"label\": \"#1564\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1563\", \"label\": \"#1563\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1568\", \"label\": \"#1568\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1551\", \"label\": \"#1551\"}]"} {"id": "changelog:facet-by-date", "page": "changelog", "ref": "facet-by-date", "title": "Facet by date", "content": "If a column contains datetime values, Datasette can now facet that column by date. ( #481 )", "breadcrumbs": "[\"Changelog\", \"0.29 (2019-07-07)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/481\", \"label\": \"#481\"}]"} {"id": "changelog:id36", "page": "changelog", "ref": "id36", "title": "Other changes", "content": "Datasette can now open multiple database files with the same name, e.g. if you run datasette path/to/one.db path/to/other/one.db . ( #509 ) \n \n \n datasette publish cloudrun now sets force_https_urls for every deployment, fixing some incorrect http:// links. ( #1178 ) \n \n \n Fixed a bug in the example nginx configuration in Running Datasette behind a proxy . ( #1091 ) \n \n \n The Datasette Ecosystem documentation page has been reduced in size in favour of the datasette.io tools and plugins directories. ( #1182 ) \n \n \n The request object now provides a request.full_path property, which returns the path including any query string. ( #1184 ) \n \n \n Better error message for disallowed PRAGMA clauses in SQL queries. ( #1185 ) \n \n \n datasette publish heroku now deploys using python-3.8.7 . \n \n \n New plugin testing documentation on Testing outbound HTTP calls with pytest-httpx . ( #1198 ) \n \n \n All ?_* query string parameters passed to the table page are now persisted in hidden form fields, so parameters such as ?_size=10 will be correctly passed to the next page when query filters are changed. ( #1194 ) \n \n \n Fixed a bug loading a database file called test-database (1).sqlite . ( #1181 )", "breadcrumbs": "[\"Changelog\", \"0.54 (2021-01-25)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/509\", \"label\": \"#509\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1178\", \"label\": \"#1178\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1091\", \"label\": \"#1091\"}, {\"href\": \"https://datasette.io/tools\", \"label\": \"tools\"}, {\"href\": \"https://datasette.io/plugins\", \"label\": \"plugins\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1182\", \"label\": \"#1182\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1184\", \"label\": \"#1184\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1185\", \"label\": \"#1185\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1198\", \"label\": \"#1198\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1194\", \"label\": \"#1194\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1181\", \"label\": \"#1181\"}]"} {"id": "changelog:new-plugin-hook-asgi-wrapper", "page": "changelog", "ref": "new-plugin-hook-asgi-wrapper", "title": "New plugin hook: asgi_wrapper", "content": "The asgi_wrapper(datasette) plugin hook allows plugins to entirely wrap the Datasette ASGI application in their own ASGI middleware. ( #520 ) \n Two new plugins take advantage of this hook: \n \n \n datasette-auth-github adds a authentication layer: users will have to sign in using their GitHub account before they can view data or interact with Datasette. You can also use it to restrict access to specific GitHub users, or to members of specified GitHub organizations or teams . \n \n \n datasette-cors allows you to configure CORS headers for your Datasette instance. You can use this to enable JavaScript running on a whitelisted set of domains to make fetch() calls to the JSON API provided by your Datasette instance.", "breadcrumbs": "[\"Changelog\", \"0.29 (2019-07-07)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/520\", \"label\": \"#520\"}, {\"href\": \"https://github.com/simonw/datasette-auth-github\", \"label\": \"datasette-auth-github\"}, {\"href\": \"https://help.github.com/en/articles/about-organizations\", \"label\": \"organizations\"}, {\"href\": \"https://help.github.com/en/articles/organizing-members-into-teams\", \"label\": \"teams\"}, {\"href\": \"https://github.com/simonw/datasette-cors\", \"label\": \"datasette-cors\"}, {\"href\": \"https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS\", \"label\": \"CORS headers\"}]"} {"id": "changelog:id83", "page": "changelog", "ref": "id83", "title": "0.29.1 (2019-07-11)", "content": "Fixed bug with static mounts using relative paths which could lead to traversal exploits ( #555 ) - thanks Abdussamet Kocak! \n \n \n Datasette can now be run as a module: python -m datasette ( #556 ) - thanks, Abdussamet Kocak!", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/555\", \"label\": \"#555\"}, {\"href\": \"https://github.com/simonw/datasette/issues/556\", \"label\": \"#556\"}]"} {"id": "changelog:id81", "page": "changelog", "ref": "id81", "title": "0.29.3 (2019-09-02)", "content": "Fixed implementation of CodeMirror on database page ( #560 ) \n \n \n Documentation typo fixes - thanks, Min ho Kim ( #561 ) \n \n \n Mechanism for detecting if a table has FTS enabled now works if the table name used alternative escaping mechanisms ( #570 ) - for compatibility with a recent change to sqlite-utils .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/560\", \"label\": \"#560\"}, {\"href\": \"https://github.com/simonw/datasette/pull/561\", \"label\": \"#561\"}, {\"href\": \"https://github.com/simonw/datasette/issues/570\", \"label\": \"#570\"}, {\"href\": \"https://github.com/simonw/sqlite-utils/pull/57\", \"label\": \"a recent change to sqlite-utils\"}]"} {"id": "changelog:id70", "page": "changelog", "ref": "id70", "title": "0.36 (2020-02-21)", "content": "The datasette object passed to plugins now has API documentation: Datasette class . ( #576 ) \n \n \n New methods on datasette : .add_database() and .remove_database() - documentation . ( #671 ) \n \n \n prepare_connection() plugin hook now takes optional datasette and database arguments - prepare_connection(conn, database, datasette) . ( #678 ) \n \n \n Added three new plugins and one new conversion tool to the The Datasette Ecosystem .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/576\", \"label\": \"#576\"}, {\"href\": \"https://github.com/simonw/datasette/issues/671\", \"label\": \"#671\"}, {\"href\": \"https://github.com/simonw/datasette/issues/678\", \"label\": \"#678\"}]"} {"id": "changelog:id80", "page": "changelog", "ref": "id80", "title": "0.30 (2019-10-18)", "content": "Added /-/threads debugging page \n \n \n Allow EXPLAIN WITH... ( #583 ) \n \n \n Button to format SQL - thanks, Tobias Kunze ( #136 ) \n \n \n Sort databases on homepage by argument order - thanks, Tobias Kunze ( #585 ) \n \n \n Display metadata footer on custom SQL queries - thanks, Tobias Kunze ( #589 ) \n \n \n Use --platform=managed for publish cloudrun ( #587 ) \n \n \n Fixed bug returning non-ASCII characters in CSV ( #584 ) \n \n \n Fix for /foo v.s. /foo-bar bug ( #601 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/583\", \"label\": \"#583\"}, {\"href\": \"https://github.com/simonw/datasette/issues/136\", \"label\": \"#136\"}, {\"href\": \"https://github.com/simonw/datasette/issues/585\", \"label\": \"#585\"}, {\"href\": \"https://github.com/simonw/datasette/pull/589\", \"label\": \"#589\"}, {\"href\": \"https://github.com/simonw/datasette/issues/587\", \"label\": \"#587\"}, {\"href\": \"https://github.com/simonw/datasette/issues/584\", \"label\": \"#584\"}, {\"href\": \"https://github.com/simonw/datasette/issues/601\", \"label\": \"#601\"}]"} {"id": "changelog:id79", "page": "changelog", "ref": "id79", "title": "0.30.1 (2019-10-30)", "content": "Fixed bug where ?_where= parameter was not persisted in hidden form fields ( #604 ) \n \n \n Fixed bug with .JSON representation of row pages - thanks, Chris Shaw ( #603 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/604\", \"label\": \"#604\"}, {\"href\": \"https://github.com/simonw/datasette/issues/603\", \"label\": \"#603\"}]"} {"id": "changelog:id78", "page": "changelog", "ref": "id78", "title": "0.30.2 (2019-11-02)", "content": "/-/plugins page now uses distribution name e.g. datasette-cluster-map instead of the name of the underlying Python package ( datasette_cluster_map ) ( #606 ) \n \n \n Array faceting is now only suggested for columns that contain arrays of strings ( #562 ) \n \n \n Better documentation for the --host argument ( #574 ) \n \n \n Don't show None with a broken link for the label on a nullable foreign key ( #406 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/606\", \"label\": \"#606\"}, {\"href\": \"https://github.com/simonw/datasette/issues/562\", \"label\": \"#562\"}, {\"href\": \"https://github.com/simonw/datasette/issues/574\", \"label\": \"#574\"}, {\"href\": \"https://github.com/simonw/datasette/issues/406\", \"label\": \"#406\"}]"} {"id": "changelog:new-features", "page": "changelog", "ref": "new-features", "title": "New features", "content": "If an error occurs while executing a user-provided SQL query, that query is now re-displayed in an editable form along with the error message. ( #619 ) \n \n \n New ?_col= and ?_nocol= parameters to show and hide columns in a table, plus an interface for hiding and showing columns in the column cog menu. ( #615 ) \n \n \n A new ?_facet_size= parameter for customizing the number of facet results returned on a table or view page. ( #1332 ) \n \n \n ?_facet_size=max sets that to the maximum, which defaults to 1,000 and is controlled by the the max_returned_rows setting. If facet results are truncated the \u2026 at the bottom of the facet list now links to this parameter. ( #1337 ) \n \n \n ?_nofacet=1 option to disable all facet calculations on a page, used as a performance optimization for CSV exports and ?_shape=array/object . ( #1349 , #263 ) \n \n \n ?_nocount=1 option to disable full query result counts. ( #1353 ) \n \n \n ?_trace=1 debugging option is now controlled by the new trace_debug setting, which is turned off by default. ( #1359 )", "breadcrumbs": "[\"Changelog\", \"0.57 (2021-06-05)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/619\", \"label\": \"#619\"}, {\"href\": \"https://github.com/simonw/datasette/issues/615\", \"label\": \"#615\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1332\", \"label\": \"#1332\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1337\", \"label\": \"#1337\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1349\", \"label\": \"#1349\"}, {\"href\": \"https://github.com/simonw/datasette/issues/263\", \"label\": \"#263\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1353\", \"label\": \"#1353\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1359\", \"label\": \"#1359\"}]"} {"id": "changelog:id75", "page": "changelog", "ref": "id75", "title": "0.31.2 (2019-11-13)", "content": "Fixed a bug where datasette publish heroku applications failed to start ( #633 ) \n \n \n Fix for datasette publish with just --source_url - thanks, Stanley Zheng ( #572 ) \n \n \n Deployments to Heroku now use Python 3.8.0 ( #632 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/633\", \"label\": \"#633\"}, {\"href\": \"https://github.com/simonw/datasette/issues/572\", \"label\": \"#572\"}, {\"href\": \"https://github.com/simonw/datasette/issues/632\", \"label\": \"#632\"}]"} {"id": "changelog:id73", "page": "changelog", "ref": "id73", "title": "0.33 (2019-12-22)", "content": "rowid is now included in dropdown menus for filtering tables ( #636 ) \n \n \n Columns are now only suggested for faceting if they have at least one value with more than one record ( #638 ) \n \n \n Queries with no results now display \"0 results\" ( #637 ) \n \n \n Improved documentation for the --static option ( #641 ) \n \n \n asyncio task information is now included on the /-/threads debug page \n \n \n Bumped Uvicorn dependency 0.11 \n \n \n You can now use --port 0 to listen on an available port \n \n \n New template_debug setting for debugging templates, e.g. https://latest.datasette.io/fixtures/roadside_attractions?_context=1 ( #654 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/636\", \"label\": \"#636\"}, {\"href\": \"https://github.com/simonw/datasette/issues/638\", \"label\": \"#638\"}, {\"href\": \"https://github.com/simonw/datasette/issues/637\", \"label\": \"#637\"}, {\"href\": \"https://github.com/simonw/datasette/issues/641\", \"label\": \"#641\"}, {\"href\": \"https://latest.datasette.io/fixtures/roadside_attractions?_context=1\", \"label\": \"https://latest.datasette.io/fixtures/roadside_attractions?_context=1\"}, {\"href\": \"https://github.com/simonw/datasette/issues/654\", \"label\": \"#654\"}]"} {"id": "changelog:id64", "page": "changelog", "ref": "id64", "title": "0.41 (2020-05-06)", "content": "You can now create custom pages within your Datasette instance using a custom template file. For example, adding a template file called templates/pages/about.html will result in a new page being served at /about on your instance. See the custom pages documentation for full details, including how to return custom HTTP headers, redirects and status codes. ( #648 ) \n Configuration directory mode ( #731 ) allows you to define a custom Datasette instance as a directory. So instead of running the following: \n datasette one.db two.db \\\n --metadata=metadata.json \\\n --template-dir=templates/ \\\n --plugins-dir=plugins \\\n --static css:css \n You can instead arrange your files in a single directory called my-project and run this: \n datasette my-project/ \n Also in this release: \n \n \n New NOT LIKE table filter: ?colname__notlike=expression . ( #750 ) \n \n \n Datasette now has a pattern portfolio at /-/patterns - e.g. https://latest.datasette.io/-/patterns . This is a page that shows every Datasette user interface component in one place, to aid core development and people building custom CSS themes. ( #151 ) \n \n \n SQLite PRAGMA functions such as pragma_table_info(tablename) are now allowed in Datasette SQL queries. ( #761 ) \n \n \n Datasette pages now consistently return a content-type of text/html; charset=utf-8\" . ( #752 ) \n \n \n Datasette now handles an ASGI raw_path value of None , which should allow compatibility with the Mangum adapter for running ASGI apps on AWS Lambda. Thanks, Colin Dellow. ( #719 ) \n \n \n Installation documentation now covers how to Using pipx . ( #756 ) \n \n \n Improved the documentation for Full-text search . ( #748 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/648\", \"label\": \"#648\"}, {\"href\": \"https://github.com/simonw/datasette/issues/731\", \"label\": \"#731\"}, {\"href\": \"https://github.com/simonw/datasette/issues/750\", \"label\": \"#750\"}, {\"href\": \"https://latest.datasette.io/-/patterns\", \"label\": \"https://latest.datasette.io/-/patterns\"}, {\"href\": \"https://github.com/simonw/datasette/issues/151\", \"label\": \"#151\"}, {\"href\": \"https://www.sqlite.org/pragma.html#pragfunc\", \"label\": \"PRAGMA functions\"}, {\"href\": \"https://github.com/simonw/datasette/issues/761\", \"label\": \"#761\"}, {\"href\": \"https://github.com/simonw/datasette/issues/752\", \"label\": \"#752\"}, {\"href\": \"https://github.com/erm/mangum\", \"label\": \"Mangum\"}, {\"href\": \"https://github.com/simonw/datasette/pull/719\", \"label\": \"#719\"}, {\"href\": \"https://github.com/simonw/datasette/issues/756\", \"label\": \"#756\"}, {\"href\": \"https://github.com/simonw/datasette/issues/748\", \"label\": \"#748\"}]"} {"id": "changelog:id72", "page": "changelog", "ref": "id72", "title": "0.34 (2020-01-29)", "content": "_search= queries are now correctly escaped using a new escape_fts() custom SQL function. This means you can now run searches for strings like park. without seeing errors. ( #651 ) \n \n \n Google Cloud Run is no longer in beta, so datasette publish cloudrun has been updated to work even if the user has not installed the gcloud beta components package. Thanks, Katie McLaughlin ( #660 ) \n \n \n datasette package now accepts a --port option for specifying which port the resulting Docker container should listen on. ( #661 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/651\", \"label\": \"#651\"}, {\"href\": \"https://cloud.google.com/run/\", \"label\": \"Google Cloud Run\"}, {\"href\": \"https://github.com/simonw/datasette/pull/660\", \"label\": \"#660\"}, {\"href\": \"https://github.com/simonw/datasette/issues/661\", \"label\": \"#661\"}]"} {"id": "changelog:id69", "page": "changelog", "ref": "id69", "title": "0.37 (2020-02-25)", "content": "Plugins now have a supported mechanism for writing to a database, using the new .execute_write() and .execute_write_fn() methods. Documentation . ( #682 ) \n \n \n Immutable databases that have had their rows counted using the inspect command now use the calculated count more effectively - thanks, Kevin Keogh. ( #666 ) \n \n \n --reload no longer restarts the server if a database file is modified, unless that database was opened immutable mode with -i . ( #494 ) \n \n \n New ?_searchmode=raw option turns off escaping for FTS queries in ?_search= allowing full use of SQLite's FTS5 query syntax . ( #676 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/682\", \"label\": \"#682\"}, {\"href\": \"https://github.com/simonw/datasette/pull/666\", \"label\": \"#666\"}, {\"href\": \"https://github.com/simonw/datasette/issues/494\", \"label\": \"#494\"}, {\"href\": \"https://www.sqlite.org/fts5.html#full_text_query_syntax\", \"label\": \"FTS5 query syntax\"}, {\"href\": \"https://github.com/simonw/datasette/issues/676\", \"label\": \"#676\"}]"} {"id": "changelog:id63", "page": "changelog", "ref": "id63", "title": "0.42 (2020-05-08)", "content": "A small release which provides improved internal methods for use in plugins, along with documentation. See #685 . \n \n \n Added documentation for db.execute() , see await db.execute(sql, ...) . \n \n \n Renamed db.execute_against_connection_in_thread() to db.execute_fn() and made it a documented method, see await db.execute_fn(fn) . \n \n \n New results.first() and results.single_value() methods, plus documentation for the Results class - see Results .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/685\", \"label\": \"#685\"}]"} {"id": "changelog:better-plugin-documentation", "page": "changelog", "ref": "better-plugin-documentation", "title": "Better plugin documentation", "content": "The plugin documentation has been re-arranged into four sections, including a brand new section on testing plugins. ( #687 ) \n \n \n Plugins introduces Datasette's plugin system and describes how to install and configure plugins. \n \n \n Writing plugins describes how to author plugins, from one-off single file plugins to packaged plugins that can be published to PyPI. It also describes how to start a plugin using the new datasette-plugin cookiecutter template. \n \n \n Plugin hooks is a full list of detailed documentation for every Datasette plugin hook. \n \n \n Testing plugins describes how to write tests for Datasette plugins, using pytest and HTTPX .", "breadcrumbs": "[\"Changelog\", \"0.45 (2020-07-01)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/687\", \"label\": \"#687\"}, {\"href\": \"https://github.com/simonw/datasette-plugin\", \"label\": \"datasette-plugin\"}, {\"href\": \"https://docs.pytest.org/\", \"label\": \"pytest\"}, {\"href\": \"https://www.python-httpx.org/\", \"label\": \"HTTPX\"}]"} {"id": "changelog:id68", "page": "changelog", "ref": "id68", "title": "0.37.1 (2020-03-02)", "content": "Don't attempt to count table rows to display on the index page for databases > 100MB. ( #688 ) \n \n \n Print exceptions if they occur in the write thread rather than silently swallowing them. \n \n \n Handle the possibility of scope[\"path\"] being a string rather than bytes \n \n \n Better documentation for the extra_template_vars(template, database, table, columns, view_name, request, datasette) plugin hook.", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/688\", \"label\": \"#688\"}]"} {"id": "changelog:id212", "page": "changelog", "ref": "id212", "title": "0.8 (2017-11-13)", "content": "V0.8 - added PyPI metadata, ready to ship. \n \n \n Implemented offset/limit pagination for views ( #70 ). \n \n \n Improved pagination. ( #78 ) \n \n \n Limit on max rows returned, controlled by --max_returned_rows option. ( #69 ) \n If someone executes 'select * from table' against a table with a million rows\n in it, we could run into problems: just serializing that much data as JSON is\n likely to lock up the server. \n Solution: we now have a hard limit on the maximum number of rows that can be\n returned by a query. If that limit is exceeded, the server will return a\n \"truncated\": true field in the JSON. \n This limit can be optionally controlled by the new --max_returned_rows \n option. Setting that option to 0 disables the limit entirely.", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/70\", \"label\": \"#70\"}, {\"href\": \"https://github.com/simonw/datasette/issues/78\", \"label\": \"#78\"}, {\"href\": \"https://github.com/simonw/datasette/issues/69\", \"label\": \"#69\"}]"} {"id": "changelog:id61", "page": "changelog", "ref": "id61", "title": "Smaller changes", "content": "New internals documentation for Request object and Response class . ( #706 ) \n \n \n request.url now respects the force_https_urls config setting. closes ( #781 ) \n \n \n request.args.getlist() returns [] if missing. Removed request.raw_args entirely. ( #774 ) \n \n \n New datasette.get_database() method. \n \n \n Added _ prefix to many private, undocumented methods of the Datasette class. ( #576 ) \n \n \n Removed the db.get_outbound_foreign_keys() method which duplicated the behaviour of db.foreign_keys_for_table() . \n \n \n New await datasette.permission_allowed() method. \n \n \n /-/actor debugging endpoint for viewing the currently authenticated actor. \n \n \n New request.cookies property. \n \n \n /-/plugins endpoint now shows a list of hooks implemented by each plugin, e.g. https://latest.datasette.io/-/plugins?all=1 \n \n \n request.post_vars() method no longer discards empty values. \n \n \n New \"params\" canned query key for explicitly setting named parameters, see Canned query parameters . ( #797 ) \n \n \n request.args is now a MultiParams object. \n \n \n Fixed a bug with the datasette plugins command. ( #802 ) \n \n \n Nicer pattern for using make_app_client() in tests. ( #395 ) \n \n \n New request.actor property. \n \n \n Fixed broken CSS on nested 404 pages. ( #777 ) \n \n \n New request.url_vars property. ( #822 ) \n \n \n Fixed a bug with the python tests/fixtures.py command for outputting Datasette's testing fixtures database and plugins. ( #804 ) \n \n \n datasette publish heroku now deploys using Python 3.8.3. \n \n \n Added a warning that the register_facet_classes() hook is unstable and may change in the future. ( #830 ) \n \n \n The {\"$env\": \"ENVIRONMENT_VARIBALE\"} mechanism (see Secret configuration values ) now works with variables inside nested lists. ( #837 )", "breadcrumbs": "[\"Changelog\", \"0.44 (2020-06-11)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/706\", \"label\": \"#706\"}, {\"href\": \"https://github.com/simonw/datasette/issues/781\", \"label\": \"#781\"}, {\"href\": \"https://github.com/simonw/datasette/issues/774\", \"label\": \"#774\"}, {\"href\": \"https://github.com/simonw/datasette/issues/576\", \"label\": \"#576\"}, {\"href\": \"https://latest.datasette.io/-/plugins?all=1\", \"label\": \"https://latest.datasette.io/-/plugins?all=1\"}, {\"href\": \"https://github.com/simonw/datasette/issues/797\", \"label\": \"#797\"}, {\"href\": \"https://github.com/simonw/datasette/issues/802\", \"label\": \"#802\"}, {\"href\": \"https://github.com/simonw/datasette/issues/395\", \"label\": \"#395\"}, {\"href\": \"https://github.com/simonw/datasette/issues/777\", \"label\": \"#777\"}, {\"href\": \"https://github.com/simonw/datasette/issues/822\", \"label\": \"#822\"}, {\"href\": \"https://github.com/simonw/datasette/issues/804\", \"label\": \"#804\"}, {\"href\": \"https://github.com/simonw/datasette/issues/830\", \"label\": \"#830\"}, {\"href\": \"https://github.com/simonw/datasette/issues/837\", \"label\": \"#837\"}]"} {"id": "changelog:id65", "page": "changelog", "ref": "id65", "title": "0.40 (2020-04-21)", "content": "Datasette Metadata can now be provided as a YAML file as an optional alternative to JSON. ( #713 ) \n \n \n Removed support for datasette publish now , which used the the now-retired Zeit Now v1 hosting platform. A new plugin, datasette-publish-now , can be installed to publish data to Zeit ( now Vercel ) Now v2. ( #710 ) \n \n \n Fixed a bug where the extra_template_vars(request, view_name) plugin hook was not receiving the correct view_name . ( #716 ) \n \n \n Variables added to the template context by the extra_template_vars() plugin hook are now shown in the ?_context=1 debugging mode (see template_debug ). ( #693 ) \n \n \n Fixed a bug where the \"templates considered\" HTML comment was no longer being displayed. ( #689 ) \n \n \n Fixed a datasette publish bug where --plugin-secret would over-ride plugin configuration in the provided metadata.json file. ( #724 ) \n \n \n Added a new CSS class for customizing the canned query page. ( #727 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/713\", \"label\": \"#713\"}, {\"href\": \"https://github.com/simonw/datasette-publish-now\", \"label\": \"datasette-publish-now\"}, {\"href\": \"https://vercel.com/blog/zeit-is-now-vercel\", \"label\": \"now Vercel\"}, {\"href\": \"https://github.com/simonw/datasette/issues/710\", \"label\": \"#710\"}, {\"href\": \"https://github.com/simonw/datasette/issues/716\", \"label\": \"#716\"}, {\"href\": \"https://github.com/simonw/datasette/issues/693\", \"label\": \"#693\"}, {\"href\": \"https://github.com/simonw/datasette/issues/689\", \"label\": \"#689\"}, {\"href\": \"https://github.com/simonw/datasette/issues/724\", \"label\": \"#724\"}, {\"href\": \"https://github.com/simonw/datasette/issues/727\", \"label\": \"#727\"}]"} {"id": "changelog:v1-0-a3", "page": "changelog", "ref": "v1-0-a3", "title": "1.0a3 (2023-08-09)", "content": "This alpha release previews the updated design for Datasette's default JSON API. ( #782 ) \n The new default JSON representation for both table pages ( /dbname/table.json ) and arbitrary SQL queries ( /dbname.json?sql=... ) is now shaped like this: \n {\n \"ok\": true,\n \"rows\": [\n {\n \"id\": 3,\n \"name\": \"Detroit\"\n },\n {\n \"id\": 2,\n \"name\": \"Los Angeles\"\n },\n {\n \"id\": 4,\n \"name\": \"Memnonia\"\n },\n {\n \"id\": 1,\n \"name\": \"San Francisco\"\n }\n ],\n \"truncated\": false\n} \n Tables will include an additional \"next\" key for pagination, which can be passed to ?_next= to fetch the next page of results. \n The various ?_shape= options continue to work as before - see Different shapes for details. \n A new ?_extra= mechanism is available for tables, but has not yet been stabilized or documented. Details on that are available in #262 .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/782\", \"label\": \"#782\"}, {\"href\": \"https://github.com/simonw/datasette/issues/262\", \"label\": \"#262\"}]"} {"id": "changelog:permissions", "page": "changelog", "ref": "permissions", "title": "Permissions", "content": "Datasette also now has a built-in concept of Permissions . The permissions system answers the following question: \n \n Is this actor allowed to perform this action , optionally against this particular resource ? \n \n You can use the new \"allow\" block syntax in metadata.json (or metadata.yaml ) to set required permissions at the instance, database, table or canned query level. For example, to restrict access to the fixtures.db database to the \"root\" user: \n {\n \"databases\": {\n \"fixtures\": {\n \"allow\": {\n \"id\" \"root\"\n }\n }\n }\n} \n See Defining permissions with \"allow\" blocks for more details. \n Plugins can implement their own custom permission checks using the new permission_allowed(datasette, actor, action, resource) hook. \n A new debug page at /-/permissions shows recent permission checks, to help administrators and plugin authors understand exactly what checks are being performed. This tool defaults to only being available to the root user, but can be exposed to other users by plugins that respond to the permissions-debug permission. ( #788 )", "breadcrumbs": "[\"Changelog\", \"0.44 (2020-06-11)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/788\", \"label\": \"#788\"}]"} {"id": "changelog:flash-messages", "page": "changelog", "ref": "flash-messages", "title": "Flash messages", "content": "Writable canned queries needed a mechanism to let the user know that the query has been successfully executed. The new flash messaging system ( #790 ) allows messages to persist in signed cookies which are then displayed to the user on the next page that they visit. Plugins can use this mechanism to display their own messages, see .add_message(request, message, type=datasette.INFO) for details. \n You can try out the new messages using the /-/messages debug tool, for example at https://latest.datasette.io/-/messages", "breadcrumbs": "[\"Changelog\", \"0.44 (2020-06-11)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/790\", \"label\": \"#790\"}, {\"href\": \"https://latest.datasette.io/-/messages\", \"label\": \"https://latest.datasette.io/-/messages\"}]"} {"id": "changelog:csrf-protection", "page": "changelog", "ref": "csrf-protection", "title": "CSRF protection", "content": "Since writable canned queries are built using POST forms, Datasette now ships with CSRF protection ( #798 ). This applies automatically to any POST request, which means plugins need to include a csrftoken in any POST forms that they render. They can do that like so: \n ", "breadcrumbs": "[\"Changelog\", \"0.44 (2020-06-11)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/798\", \"label\": \"#798\"}]"} {"id": "changelog:register-routes-plugin-hooks", "page": "changelog", "ref": "register-routes-plugin-hooks", "title": "register_routes() plugin hooks", "content": "Plugins can now register new views and routes via the register_routes(datasette) plugin hook ( #819 ). View functions can be defined that accept any of the current datasette object, the current request , or the ASGI scope , send and receive objects.", "breadcrumbs": "[\"Changelog\", \"0.44 (2020-06-11)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/819\", \"label\": \"#819\"}]"} {"id": "changelog:id209", "page": "changelog", "ref": "id209", "title": "0.10 (2017-11-14)", "content": "Fixed #83 - 500 error on individual row pages. \n \n \n Stop using sqlite WITH RECURSIVE in our tests. \n The version of Python 3 running in Travis CI doesn't support this.", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/83\", \"label\": \"#83\"}]"} {"id": "changelog:id59", "page": "changelog", "ref": "id59", "title": "Smaller changes", "content": "Cascading view permissions - so if a user has view-table they can view the table page even if they do not have view-database or view-instance . ( #832 ) \n \n \n CSRF protection no longer applies to Authentication: Bearer token requests or requests without cookies. ( #835 ) \n \n \n datasette.add_message() now works inside plugins. ( #864 ) \n \n \n Workaround for \"Too many open files\" error in test runs. ( #846 ) \n \n \n Respect existing scope[\"actor\"] if already set by ASGI middleware. ( #854 ) \n \n \n New process for shipping Alpha and beta releases . ( #807 ) \n \n \n {{ csrftoken() }} now works when plugins render a template using datasette.render_template(..., request=request) . ( #863 ) \n \n \n Datasette now creates a single Request object and uses it throughout the lifetime of the current HTTP request. ( #870 )", "breadcrumbs": "[\"Changelog\", \"0.45 (2020-07-01)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/832\", \"label\": \"#832\"}, {\"href\": \"https://github.com/simonw/datasette/issues/835\", \"label\": \"#835\"}, {\"href\": \"https://github.com/simonw/datasette/issues/864\", \"label\": \"#864\"}, {\"href\": \"https://github.com/simonw/datasette/issues/846\", \"label\": \"#846\"}, {\"href\": \"https://github.com/simonw/datasette/issues/854\", \"label\": \"#854\"}, {\"href\": \"https://github.com/simonw/datasette/issues/807\", \"label\": \"#807\"}, {\"href\": \"https://github.com/simonw/datasette/issues/863\", \"label\": \"#863\"}, {\"href\": \"https://github.com/simonw/datasette/issues/870\", \"label\": \"#870\"}]"} {"id": "changelog:log-out", "page": "changelog", "ref": "log-out", "title": "Log out", "content": "The ds_actor cookie can be used by plugins (or by Datasette's --root mechanism ) to authenticate users. The new /-/logout page provides a way to clear that cookie. \n A \"Log out\" button now shows in the global navigation provided the user is authenticated using the ds_actor cookie. ( #840 )", "breadcrumbs": "[\"Changelog\", \"0.45 (2020-07-01)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/840\", \"label\": \"#840\"}]"} {"id": "changelog:magic-parameters-for-canned-queries", "page": "changelog", "ref": "magic-parameters-for-canned-queries", "title": "Magic parameters for canned queries", "content": "Canned queries now support Magic parameters , which can be used to insert or select automatically generated values. For example: \n insert into logs\n (user_id, timestamp)\nvalues\n (:_actor_id, :_now_datetime_utc) \n This inserts the currently authenticated actor ID and the current datetime. ( #842 )", "breadcrumbs": "[\"Changelog\", \"0.45 (2020-07-01)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/842\", \"label\": \"#842\"}]"} {"id": "changelog:id49", "page": "changelog", "ref": "id49", "title": "0.50 (2020-10-09)", "content": "The key new feature in this release is the column actions menu on the table page ( #891 ). This can be used to sort a column in ascending or descending order, facet data by that column or filter the table to just rows that have a value for that column. \n Plugin authors can use the new datasette.client object to make internal HTTP requests from their plugins, allowing them to make use of Datasette's JSON API. ( #943 ) \n New Deploying Datasette documentation with guides for deploying Datasette on a Linux server using systemd or to hosting providers that support buildpacks . ( #514 , #997 ) \n Other improvements in this release: \n \n \n Publishing to Google Cloud Run documentation now covers Google Cloud SDK options. Thanks, Geoffrey Hing. ( #995 ) \n \n \n New datasette -o option which opens your browser as soon as Datasette starts up. ( #970 ) \n \n \n Datasette now sets sqlite3.enable_callback_tracebacks(True) so that errors in custom SQL functions will display tracebacks. ( #891 ) \n \n \n Fixed two rendering bugs with column headers in portrait mobile view. ( #978 , #980 ) \n \n \n New db.table_column_details(table) introspection method for retrieving full details of the columns in a specific table, see Database introspection . \n \n \n Fixed a routing bug with custom page wildcard templates. ( #996 ) \n \n \n datasette publish heroku now deploys using Python 3.8.6. \n \n \n New datasette publish heroku --tar= option. ( #969 ) \n \n \n OPTIONS requests against HTML pages no longer return a 500 error. ( #1001 ) \n \n \n Datasette now supports Python 3.9. \n \n \n See also Datasette 0.50: The annotated release notes .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/891\", \"label\": \"#891\"}, {\"href\": \"https://github.com/simonw/datasette/issues/943\", \"label\": \"#943\"}, {\"href\": \"https://github.com/simonw/datasette/issues/514\", \"label\": \"#514\"}, {\"href\": \"https://github.com/simonw/datasette/issues/997\", \"label\": \"#997\"}, {\"href\": \"https://github.com/simonw/datasette/pull/995\", \"label\": \"#995\"}, {\"href\": \"https://github.com/simonw/datasette/issues/970\", \"label\": \"#970\"}, {\"href\": \"https://github.com/simonw/datasette/issues/891\", \"label\": \"#891\"}, {\"href\": \"https://github.com/simonw/datasette/issues/978\", \"label\": \"#978\"}, {\"href\": \"https://github.com/simonw/datasette/issues/980\", \"label\": \"#980\"}, {\"href\": \"https://github.com/simonw/datasette/issues/996\", \"label\": \"#996\"}, {\"href\": \"https://github.com/simonw/datasette/issues/969\", \"label\": \"#969\"}, {\"href\": \"https://github.com/simonw/datasette/issues/1001\", \"label\": \"#1001\"}, {\"href\": \"https://simonwillison.net/2020/Oct/9/datasette-0-50/\", \"label\": \"Datasette 0.50: The annotated release notes\"}]"} {"id": "changelog:url-building", "page": "changelog", "ref": "url-building", "title": "URL building", "content": "The new datasette.urls family of methods can be used to generate URLs to key pages within the Datasette interface, both within custom templates and Datasette plugins. See Building URLs within plugins for more details. ( #904 )", "breadcrumbs": "[\"Changelog\", \"0.51 (2020-10-31)\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/904\", \"label\": \"#904\"}]"} {"id": "changelog:id57", "page": "changelog", "ref": "id57", "title": "0.46 (2020-08-09)", "content": "This release contains a security fix related to authenticated writable canned queries. If you are using this feature you should upgrade as soon as possible. \n \n \n \n Security fix: CSRF tokens were incorrectly included in read-only canned query forms, which could allow them to be leaked to a sophisticated attacker. See issue 918 for details. \n \n \n Datasette now supports GraphQL via the new datasette-graphql plugin - see GraphQL in Datasette with the new datasette-graphql plugin . \n \n \n Principle git branch has been renamed from master to main . ( #849 ) \n \n \n New debugging tool: /-/allow-debug tool ( demo here ) helps test allow blocks against actors, as described in Defining permissions with \"allow\" blocks . ( #908 ) \n \n \n New logo for the documentation, and a new project tagline: \"An open source multi-tool for exploring and publishing data\". \n \n \n Whitespace in column values is now respected on display, using white-space: pre-wrap . ( #896 ) \n \n \n New await request.post_body() method for accessing the raw POST body, see Request object . ( #897 ) \n \n \n Database file downloads now include a content-length HTTP header, enabling download progress bars. ( #905 ) \n \n \n File downloads now also correctly set the suggested file name using a content-disposition HTTP header. ( #909 ) \n \n \n tests are now excluded from the Datasette package properly - thanks, abeyerpath. ( #456 ) \n \n \n The Datasette package published to PyPI now includes sdist as well as bdist_wheel . \n \n \n Better titles for canned query pages. ( #887 ) \n \n \n Now only loads Python files from a directory passed using the --plugins-dir option - thanks, Amjith Ramanujam. ( #890 ) \n \n \n New documentation section on Publishing to Vercel .", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/918\", \"label\": \"issue 918\"}, {\"href\": \"https://github.com/simonw/datasette-graphql\", \"label\": \"datasette-graphql\"}, {\"href\": \"https://simonwillison.net/2020/Aug/7/datasette-graphql/\", \"label\": \"GraphQL in Datasette with the new datasette-graphql plugin\"}, {\"href\": \"https://github.com/simonw/datasette/issues/849\", \"label\": \"#849\"}, {\"href\": \"https://latest.datasette.io/-/allow-debug\", \"label\": \"demo here\"}, {\"href\": \"https://github.com/simonw/datasette/issues/908\", \"label\": \"#908\"}, {\"href\": \"https://github.com/simonw/datasette/issues/896\", \"label\": \"#896\"}, {\"href\": \"https://github.com/simonw/datasette/issues/897\", \"label\": \"#897\"}, {\"href\": \"https://github.com/simonw/datasette/issues/905\", \"label\": \"#905\"}, {\"href\": \"https://github.com/simonw/datasette/issues/909\", \"label\": \"#909\"}, {\"href\": \"https://github.com/simonw/datasette/issues/456\", \"label\": \"#456\"}, {\"href\": \"https://github.com/simonw/datasette/issues/887\", \"label\": \"#887\"}, {\"href\": \"https://github.com/simonw/datasette/pull/890\", \"label\": \"#890\"}]"} {"id": "changelog:id55", "page": "changelog", "ref": "id55", "title": "0.47.1 (2020-08-11)", "content": "Fixed a bug where the sdist distribution of Datasette was not correctly including the template files. ( #930 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/930\", \"label\": \"#930\"}]"} {"id": "changelog:id53", "page": "changelog", "ref": "id53", "title": "0.47.3 (2020-08-15)", "content": "The datasette --get command-line mechanism now ensures any plugins using the startup() hook are correctly executed. ( #934 )", "breadcrumbs": "[\"Changelog\"]", "references": "[{\"href\": \"https://github.com/simonw/datasette/issues/934\", \"label\": \"#934\"}]"} {"id": "changelog:id26", "page": "changelog", "ref": "id26", "title": "0.59 (2021-10-14)", "content": "Columns can now have associated metadata descriptions in metadata.json , see Column descriptions . ( #942 ) \n \n \n New register_commands() plugin hook allows plugins to register additional Datasette CLI commands, e.g. datasette mycommand file.db . ( #1449 ) \n \n \n Adding ?_facet_size=max to a table page now shows the number of unique values in each facet. ( #1423 ) \n \n \n Upgraded dependency httpx 0.20 - the undocumented allow_redirects= parameter to datasette.client is now follow_redirects= , and defaults to False where it previously defaulted to True . ( #1488 ) \n \n \n The --cors option now causes Datasette to return the Access-Control-Allow-Headers: Authorization header, in addition to Access-Control-Allow-Origin: * . ( #1467 ) \n \n \n Code that figures out which named parameters a SQL query takes in order to display form fields for them is no longer confused by strings that contain colon characters. ( #1421 ) \n \n \n Renamed --help-config option to --help-settings . ( #1431 ) \n \n \n datasette.databases property is now a documented API. ( #1443 ) \n \n \n The base.html template now wraps everything other than the