Wykres commitów

393 Commity (d97e82df3c8a3f2e97038d7080167be9bb74a68d)

Autor SHA1 Wiadomość Data
Simon Willison d97e82df3c
?_extra= support and TableView refactor to table_view
* Implemented ?_extra= option for JSON views, refs #262
* New dependency: asyncinject
* Remove now-obsolete TableView class
2023-03-22 15:49:39 -07:00
Simon Willison 0b4a286914 render_cell(..., request) argument, closes #2007 2023-01-27 19:34:14 -08:00
Simon Willison 572bdb5b80 Applied Black, refs #782 2022-12-31 19:32:07 -08:00
Simon Willison d94a3c4326
No need to link to _shape=objects any more
It's the default now. Refs #782
2022-12-31 17:42:48 -08:00
Simon Willison 3c352b7132 Applied Black, refs #782 2022-12-31 13:17:54 -08:00
Simon Willison 5bbe2bcc50 Rename filtered_table_rows_count to count, refs #782 2022-12-31 12:52:57 -08:00
Simon Willison c094dde3ff Extra permission rules for /-/create, closes #1937 2022-12-14 12:21:18 -08:00
Simon Willison 1a3dcf4943 Don't include _memory on /-/create-token, refs #1947 2022-12-13 21:19:31 -08:00
Simon Willison d98a8effb1 UI for restricting permissions on /-/create-token, refs #1947
Also fixes test failures I introduced in #1951
2022-12-13 21:03:17 -08:00
Simon Willison f84acae98e Return 400 errors for ?_sort errors, closes #1950 2022-12-13 14:23:17 -08:00
Simon Willison c6a811237c /-/actor.json no longer requires view-instance, closes #1945 2022-12-12 20:11:51 -08:00
Simon Willison 8bf06a76b5
register_permissions() plugin hook (#1940)
* Docs for permissions: in metadata, refs #1636
* Refactor default_permissions.py to help with implementation of #1636
* register_permissions() plugin hook, closes #1939 - also refs #1938
* Tests for register_permissions() hook, refs #1939
* Documentation for datasette.permissions, refs #1939
* permission_allowed() falls back on Permission.default, refs #1939
* Raise StartupError on duplicate permissions
* Allow dupe permisisons if exact matches
2022-12-12 18:05:54 -08:00
Simon Willison dee18ed8ce test_create_table_error_rows_twice_with_duplicates, refs #1927 2022-12-07 17:29:24 -08:00
Simon Willison 9342b60f14 test_create_table_error_if_pk_changed, refs #1927 2022-12-07 17:27:01 -08:00
Simon Willison 6b27537988 ignore/replace to create requires pk, refs #1927 2022-12-07 17:18:40 -08:00
Simon Willison 272982e8a6
/db/table/-/upsert API
Close #1878

Also made a few tweaks to how _r works in tokens and actors,
refs #1855 - I needed that mechanism for the tests.
2022-12-07 17:12:15 -08:00
Simon Willison 93ababe6f7 Initial attempt at insert/replace for /-/create, refs #1927 2022-12-02 23:00:18 -08:00
Simon Willison 9a1536b52a Move CORS headers into base class, refs #1922 2022-11-30 15:48:32 -08:00
Simon Willison 48725bb4ea CORS headers for write APIs, refs #1922 2022-11-30 09:27:10 -08:00
Simon Willison 8404b21556 405 method not allowed for GET to POST endpoints, closes #1916 2022-11-29 21:15:13 -08:00
Simon Willison 5518397338 Show mutable DBs first in API explorer, closes #1918 2022-11-29 21:07:51 -08:00
Simon Willison b8fc8e2cd7
Merge branch 'main' into 1.0-dev 2022-11-29 11:34:39 -08:00
Simon Willison 1154048f79 Compound primary key support for /db/-/create - closes #1911
Needed for tests in #1864
2022-11-29 10:47:48 -08:00
Simon Willison 484bef0d3b /db/table/pk/-/update endpoint, closes #1863 2022-11-29 10:06:19 -08:00
Simon Willison ee64130fa8 Refactor to use new resolve_database/table/row methods, refs #1896 2022-11-18 14:46:25 -08:00
Simon Willison 83a6872d1b Include views in SQL autocomplete, refs #1897 2022-11-17 18:53:48 -08:00
Simon Willison 52bf222d48 /db/-/create API endpoint, closes #1882 2022-11-17 17:24:46 -08:00
Simon Willison 98611b3da0 Include SQL schema for CodeMirror on query pages, closes #1897
Refs #1893
2022-11-17 17:24:44 -08:00
Simon Willison 3e61a41b9b Include SQL schema for CodeMirror on query pages, closes #1897
Refs #1893
2022-11-17 17:19:37 -08:00
Simon Willison 187d91d686 /db/-/create API endpoint, closes #1882 2022-11-14 21:57:28 -08:00
Simon Willison 575a29c424 API explorer: respect immutability, closes #1888 2022-11-13 22:01:56 -08:00
Simon Willison 264d0ab471 Renamed return_rows to return in insert API
Refs https://github.com/simonw/datasette/issues/1866#issuecomment-1313128913
2022-11-13 21:49:23 -08:00
Simon Willison 65521f03db Error for drop against immutable database, closes #1874 2022-11-13 21:40:10 -08:00
Simon Willison 612da8eae6 confirm: true mechanism for drop table API, closes #1887 2022-11-13 21:17:18 -08:00
Simon Willison db796771e2 Example links for API explorer, closes #1871 2022-11-13 20:58:45 -08:00
Simon Willison fa9cc9efaf Fix for redirects ignoring base_url, refs #1883 2022-11-12 12:29:59 -08:00
Simon Willison 8d9a957c63 Fix for redirects ignoring base_url, refs #1883 2022-11-10 22:49:54 -08:00
Simon Willison bcc781f4c5 Implementation and tests for _r field on actor, refs #1855
New mechanism for restricting permissions further for a given actor.

This still needs documentation. It will eventually be used by the mechanism to issue
signed API tokens that are only able to perform a subset of actions.

This also adds tests that exercise the POST /-/permissions tool, refs #1881
2022-11-03 17:12:23 -07:00
Simon Willison fb8b6b2311 Refactor _error helper function 2022-11-03 16:36:43 -07:00
Simon Willison c51d9246b9 Permission check testing tool, refs #1881 2022-11-02 22:10:07 -07:00
Simon Willison 9b5a73ba4c Applied Black 2022-11-02 21:46:05 -07:00
Simon Willison 719e757252 Return method not allowed error in JSON in some situations
Added this while playing with the new API explorer, refs #1871
2022-11-02 20:12:13 -07:00
Simon Willison 000eeb4464 Link to Datasette API docs from /-/api, refs #1871 2022-11-01 22:45:05 -07:00
Simon Willison 497290beaf Handle database errors in /-/insert, refs #1866, #1873
Also improved API explorer to show HTTP status of response, refs #1871
2022-11-01 12:59:17 -07:00
Simon Willison 9bec7c38eb ignore and replace options for bulk inserts, refs #1873
Also removed the rule that you cannot include primary keys in the rows you insert.

And added validation that catches invalid parameters in the incoming JSON.

And renamed "inserted" to "rows" in the returned JSON for return_rows: true
2022-11-01 11:08:17 -07:00
Simon Willison 93a02281da Show interrupted query in resizing textarea, closes #1876 2022-11-01 10:38:24 -07:00
Simon Willison 2ec5583629 Show interrupted query in resizing textarea, closes #1876 2022-11-01 10:22:26 -07:00
Simon Willison 00632ded30 Initial attempt at /db/table/row/-/delete, refs #1864 2022-10-30 16:16:00 -07:00
Simon Willison 2865d3956f /db/table/-/drop API, closes #1874 2022-10-30 15:17:21 -07:00
Simon Willison f6bf2d8045 Initial prototype of API explorer at /-/api, refs #1871 2022-10-29 23:20:11 -07:00