Commit graph

730 commits

Author SHA1 Message Date
Simon Willison
089278b8db rST fix, refs #1384 2021-06-26 15:49:07 -07:00
Brandon Roberts
baf986c871
New get_metadata() plugin hook for dynamic metadata
The following hook is added:

    get_metadata(
      datasette=self, key=key, database=database, table=table,
      fallback=fallback
    )

This gets called when we're building our metdata for the rest
of the system to use. We merge whatever the plugins return
with any local metadata (from metadata.yml/yaml/json) allowing
for a live-editable dynamic Datasette.

As a security precation, local meta is *not* overwritable by
plugin hooks. The workflow for transitioning to live-meta would
be to load the plugin with the full metadata.yaml and save.
Then remove the parts of the metadata that you want to be able
to change from the file.

* Avoid race condition: don't mutate databases list

This avoids the nasty "RuntimeError: OrderedDict mutated during
iteration" error that randomly happens when a plugin adds a
new database to Datasette, using `add_database`. This change
makes the add and remove database functions more expensive, but
it prevents the random explosion race conditions that make for
confusing user experience when importing live databases.

Thanks, @brandonrobertz
2021-06-26 15:24:54 -07:00
Simon Willison
ff17970ed4 Release 0.58a1
Refs #1365, #1377
2021-06-24 09:24:59 -07:00
Simon Willison
b1fd24ac9f skip_csrf(datasette, scope) plugin hook, refs #1377 2021-06-23 15:40:09 -07:00
Simon Willison
3a50015566
datasette-publish-now is now called datasette-publish-vercel 2021-06-23 12:51:19 -07:00
Simon Willison
403e370e5a
Fixed reference to default publish implementation 2021-06-23 12:50:19 -07:00
Simon Willison
cd7678fde6 Release 0.58a0
Refs #1371
2021-06-09 21:51:14 -07:00
Simon Willison
d23a267138 Make request available to menu plugin hooks, closes #1371 2021-06-09 21:45:24 -07:00
Simon Willison
a3faf37883 Release 0.57.1
Refs #1364, #1367
2021-06-08 09:26:45 -07:00
Simon Willison
58746d3c51 Release 0.57
Refs #263, #615, #619, #1238, #1257, #1305, #1308, #1320, #1332, #1337, #1349, #1353, #1359, #1360
2021-06-05 15:06:55 -07:00
Simon Willison
ff29dd55fa ?_trace=1 now depends on trace_debug setting, closes #1359 2021-06-05 13:18:37 -07:00
louispotok
368aa5f1b1
Update docs: explain allow_download setting (#1291)
* Update docs: explain allow_download setting

This fixes one possible source of confusion seen in #502 and clarifies
when database downloads will be shown and allowed.
2021-06-05 12:48:51 -07:00
Simon Willison
ff45ed0ce5 Updated --help output for latest Click, closes #1354 2021-06-01 09:16:58 -07:00
Simon Willison
fd368d3b2c New _nocount=1 option, used to speed up CSVs - closes #1353 2021-06-01 09:12:32 -07:00
Simon Willison
8bde6c5461 Rename ?_nofacets=1 to ?_nofacet=1, refs #1353 2021-06-01 08:56:00 -07:00
Simon Willison
c5ae1197a2 ?_nofacets=1 option, closes #1350 2021-05-30 22:39:14 -04:00
Simon Willison
4545120c92 Test and docs for ?_facet_size=max, refs #1337 2021-05-27 09:04:26 -07:00
Simon Willison
f1c29fd6a1
?_col=/?_nocol= to show/hide columns on the table page
Closes #615

* Cog icon for hiding columns
* Show all columns cog menu item
* Do not allow hide column on primary keys
* Allow both ?_col= and ?_nocol=
* De-duplicate if ?_col= passed multiple times
* 400 error if user tries to ?_nocol= a primary key
* Documentation for ?_col= and ?_nocol=
2021-05-26 21:17:43 -07:00
Simon Willison
c0a748e5c3
Markup fix, refs #1320 2021-05-24 11:15:15 -07:00
Simon Willison
56af118fc1
How to apt-get install in Docker container, refs #1320 2021-05-24 11:14:45 -07:00
Simon Willison
2bd9d54b27 Fix Jinja warnings, closes #1338, refs #1331 2021-05-23 18:41:50 -07:00
Simon Willison
a443dba82f Release 0.57a0
Refs #1281, #1282, #1289, #1290, #1308, #1313, #1314, #1321, #1323, #1325, #1330, #1332, #1335
2021-05-22 17:45:54 -07:00
Simon Willison
9789b94da4 ?_facet_size=100 parameter, closes #1332 2021-05-22 17:34:33 -07:00
Abdussamet Koçak
459259175e
Fix small typo (#1335) 2021-05-22 16:53:34 -07:00
Simon Willison
0a7621f96f
Use pytest-xdist to speed up tests (#1290)
* Run tests in CI using pytest-xdist
* Documentation for pytest-xdist

Closes #1289
2021-04-02 20:42:28 -07:00
Simon Willison
59ef4a20cb
© 2017-2021 2021-04-02 13:27:03 -07:00
Simon Willison
87b583a128 Clearer help text for --reload
Immutable databases are not commonly used, but it's useful to clarify
that --reload will pick up on changes to metadata.
2021-04-02 13:20:51 -07:00
Simon Willison
af5a7f1c09 Release 0.56
Refs #1005, #1031, #1141, #1229, #1236, #1239, #1246, #1247, #1252, #1266, #1276, #1278
2021-03-28 17:41:12 -07:00
Campbell Allen
f92d823766
ensure immutable databses when starting in configuration directory mode with (#1229)
* check if immutables is empty list of None
* update docs on how to create the inspect-data.json
2021-03-28 17:17:31 -07:00
vincent d warmerdam
c96a3826cf
Added --app to fly install command. (#1279) 2021-03-28 17:11:55 -07:00
Simon Willison
3fcfc85134 Fix links in SpatiaLite tutorial, closes #1278 2021-03-27 09:16:45 -07:00
Simon Willison
8ebdcc916d Remove obsolete note about building SpatiaLite from source, refs #1249 2021-03-26 21:33:15 -07:00
Simon Willison
6ad544df5e Fixed master -> main in a bunch of places, mainly docs 2021-03-23 09:19:41 -07:00
Simon Willison
c4f1ec7f33 Documentation for Response.asgi_send(), closes #1266 2021-03-20 14:32:23 -07:00
Jean-Baptiste Pressac
a1bcd2fbe5
Minor typo in IP adress (#1256)
127.0.01 replaced by 127.0.0.1
2021-03-10 10:26:39 -08:00
David Boucha
4f9a2f1f47
Fix small typo (#1243)
Thanks, @UtahDave
2021-03-03 21:46:10 -08:00
Simon Willison
7c87532acc New .add_memory_database() method, closes #1247 2021-02-28 20:02:18 -08:00
Simon Willison
afed51b1e3 Note about where to find plugin examples, closes #1244 2021-02-26 09:27:09 -08:00
Simon Willison
42caabf7e9
Fixed typo 2021-02-22 09:35:41 -08:00
Simon Willison
cb8a293bd7 Release 0.55
Refs #1205, #1207, #1214, #1221, #1226, #1227, #1232, #1235
2021-02-18 18:01:06 -08:00
Simon Willison
73bed17563
Corrected documentation for datasette.urls.static_plugins 2021-02-18 15:25:01 -08:00
Simon Willison
6f41c8a2be
--crossdb option for joining across databases (#1232)
* Test for cross-database join, refs #283
* Warn if --crossdb used with more than 10 DBs, refs #283
* latest.datasette.io demo of --crossdb joins, refs #283
* Show attached databases on /_memory page, refs #283
* Documentation for cross-database queries, refs #283
2021-02-18 14:09:12 -08:00
Simon Willison
4df548e766 Update documentation, refs #1226 2021-02-18 10:32:04 -08:00
Simon Willison
d2d53a5559 New :issue: Sphinx macro, closes #1227 2021-02-17 17:20:15 -08:00
Simon Willison
eda652cf6e
--ssl-keyfile and --ssl-certfile options to "datasette serve"
Closes #1221
2021-02-11 16:52:16 -08:00
Simon Willison
3a3de76009 Release 0.54.1
Refs #1214
2021-02-02 13:24:05 -08:00
Simon Willison
beb98bf454
Fixed typo in code example 2021-01-31 00:49:09 -08:00
Simon Willison
dde3c500c7
Using pdb for errors thrown inside Datasette
Closes #1207
2021-01-28 18:12:32 -08:00
Simon Willison
1600d2a3ec Renamed /:memory: to /_memory, with redirects - closes #1205 2021-01-28 14:48:56 -08:00
Simon Willison
382e9ecd1d Removed a rogue full-stop 2021-01-25 09:35:06 -08:00