Simon Willison
42f8b402e6
Initial prototype of create API token page, refs #1852
2022-10-25 17:07:58 -07:00
Simon Willison
5be86d48b2
Fix display of padlocks on database page, closes #1848
2022-10-23 19:42:30 -07:00
Simon Willison
78dad236df
check_visibility can now take multiple permissions into account
...
Closes #1829
2022-10-23 19:11:33 -07:00
Simon Willison
5f9f567acb
Show SQL query when reporting time limit error, closes #1819
2022-09-26 16:06:01 -07:00
Simon Willison
5aa359b869
Apply cell truncation on query page too, refs #1805
2022-09-06 16:58:30 -07:00
Simon Willison
d0737e4de5
truncate_cells_html now affects URLs too, refs #1805
2022-09-06 16:50:43 -07:00
Simon Willison
c1396bf860
Don't allow canned write queries on immutable DBs, closes #1728
2022-08-14 09:34:31 -07:00
Simon Willison
1563c22a8c
Don't duplicate _sort_desc, refs #1738
2022-08-14 09:13:12 -07:00
Simon Willison
df4fd2d7dd
_sort= works even if sort column not selected, closes #1773
2022-08-14 08:44:02 -07:00
Simon Willison
6373bb3414
Expose current SQLite row to render_cell hook, closes #1300
2022-07-07 09:30:49 -07:00
Simon Willison
280ff372ab
ETag support for .db downloads, closes #1739
2022-05-03 07:59:46 -07:00
Simon Willison
942411ef94
Execute some TableView queries in parallel
...
Use ?_noparallel=1 to opt out (undocumented, useful for benchmark comparisons)
Refs #1723 , #1715
2022-04-26 15:50:02 -07:00
Simon Willison
8a0c38f0b8
Rename database->database_name and table-> table_name, refs #1715
2022-04-26 15:50:02 -07:00
Simon Willison
579f59dcec
Refactor to remove RowTableShared class, closes #1719
...
Refs #1715
2022-04-25 11:33:35 -07:00
Simon Willison
0bc5186b7b
Tooltip and commas for byte length display, closes #1712
2022-04-12 11:44:12 -07:00
Simon Willison
c496f2b663
Don't show facet in cog menu if not allow_facet, closes #1683
2022-03-24 12:16:19 -07:00
Simon Willison
0159662ab8
Fix for bug running ?sql= against databases with a different route, closes #1682
2022-03-23 11:48:10 -07:00
Simon Willison
1a7750eb29
Documented datasette.check_visibility() method, closes #1678
2022-03-21 12:01:37 -07:00
Simon Willison
194e4f6c3f
Removed check_permission() from BaseView, closes #1677
...
Refs #1660
2022-03-21 11:41:56 -07:00
Simon Willison
e627510b76
BaseView.check_permissions is now datasette.ensure_permissions, closes #1675
...
Refs #1660
2022-03-21 10:13:16 -07:00
Simon Willison
cdbae2b93f
Fixed internal links to respect db.route, refs #1668
2022-03-19 17:31:23 -07:00
Simon Willison
7a6654a253
Databases can now have a .route separate from their .name, refs #1668
2022-03-19 17:11:17 -07:00
Simon Willison
798f075ef9
Read format from route captures, closes #1667
...
Refs #1660
2022-03-19 13:32:29 -07:00
Simon Willison
61419388c1
Rename route match groups for consistency, refs #1667 , #1660
2022-03-19 09:52:08 -07:00
Simon Willison
d4f60c2388
Remove hashed URL mode
...
Also simplified how view class routing works.
Refs #1661
2022-03-18 17:12:03 -07:00
Simon Willison
a35393b29c
Tilde encoding ( #1659 )
...
Closes #1657
Refs #1439
2022-03-15 11:01:57 -07:00
Simon Willison
1baa030eca
Switch to dash encoding for table/database/row-pk in paths
...
* Dash encoding functions, tests and docs, refs #1439
* dash encoding is now like percent encoding but with dashes
* Use dash-encoding for row PKs and ?_next=, refs #1439
* Use dash encoding for table names, refs #1439
* Use dash encoding for database names, too, refs #1439
See also https://simonwillison.net/2022/Mar/5/dash-encoding/
2022-03-07 07:38:29 -08:00
Simon Willison
23a09b0f6a
Remove JSON rel=alternate from some pages, closes #1623
2022-02-02 13:48:52 -08:00
Simon Willison
8d5779acf0
Refactored alternate_url_json mechanism, refs #1620 , #1533
2022-02-02 13:32:47 -08:00
Simon Willison
b72b2423c7
rel=alternate JSON for queries and database pages, closes #1620
2022-02-02 13:22:45 -08:00
Simon Willison
3ef47a0896
Link rel=alternate header for tables and rows
...
Also added Access-Control-Expose-Headers: Link to --cors mode.
Closes #1533
Refs https://github.com/simonw/datasette-notebook/issues/2
LL# metadata.json.1
2022-02-01 23:49:09 -08:00
Simon Willison
ab7d6a7179
Updated settings help URL to avoid redirect
2022-01-13 16:38:16 -08:00
Simon Willison
3a0f7d6488
Fixed hidden form fields bug #1527
2022-01-13 16:27:21 -08:00
Simon Willison
8c401ee0f0
Fixed remaining code and docs for new block=True default, closes #1579
2021-12-23 11:18:20 -08:00
Simon Willison
ace86566b2
Remove concept of special_args, re-arrange TableView a bit, refs #1518
2021-12-22 12:23:05 -08:00
Simon Willison
4094741c28
Fixed bug with custom templates for writable canned queries, closes #1547
2021-12-19 13:11:57 -08:00
Simon Willison
d0f24f9bbc
Clarifying comment
...
The new filters stuff is a little bit action-at-a-distance
2021-12-17 15:55:06 -08:00
Simon Willison
aa7f0037a4
filters_from_request plugin hook, now used in TableView
...
- New `filters_from_request` plugin hook, closes #473
- Used it to extract the logic from TableView that handles `_search` and
`_through` and `_where` - refs #1518
Also needed for this plugin work: https://github.com/simonw/datasette-leaflet-freedraw/issues/7
2021-12-17 11:02:14 -08:00
Simon Willison
0663d5525c
More comments in TableView.data(), refs #1518
2021-12-16 14:00:29 -08:00
Simon Willison
2c07327d23
Move columns_to_select to TableView class, add lots of comments, refs #1518
2021-12-16 13:43:44 -08:00
Simon Willison
95d0dd7a1c
Fix for colliding facet types bug, closes #625
...
Refs #830
2021-12-16 12:12:04 -08:00
Simon Willison
992496f261
?_nosuggest=1 parameter for table views, closes #1557
2021-12-16 11:24:54 -08:00
Simon Willison
eb53837d2a
Always show count of distinct facet values, closes #1556
...
Refs #1423
2021-12-15 09:58:01 -08:00
Simon Willison
a6ff123de5
keep_blank_values=True when parsing query_string, closes #1551
...
Refs #1518
2021-12-12 12:01:51 -08:00
Simon Willison
a37ee74891
Correct link to _ prefix on row page, closes #1525
2021-11-29 22:34:31 -08:00
Simon Willison
06762776f7
Fix for incorrect hidden for fields for _columns, refs #1527
2021-11-29 19:04:35 -08:00
Simon Willison
08947fa764
Fix more broken base_url links
...
Refs #1519 , #838
2021-11-20 11:03:08 -08:00
Simon Willison
640031edfd
Fixed bug introduced in #1519
2021-11-19 17:01:17 -08:00
Simon Willison
fe687fd020
Fixed a whole bunch of broken base_url links
...
Refs #1519 , #838
2021-11-19 16:53:11 -08:00
Simon Willison
1c13e1af06
Ensure query columns are included too, ref #1503
2021-11-13 21:08:33 -08:00
Simon Willison
c9e3cfecc8
Columns in filters now ignore ?_nocol, closes #1503
2021-11-13 20:53:00 -08:00
Simon Willison
8584993529
--cors Access-Control-Allow-Headers: Authorization
...
Refs #1467 , refs https://github.com/simonw/datasette-auth-tokens/issues/4
2021-10-14 12:03:28 -07:00
Simon Willison
b50bf5d13f
Don't persist _next in hidden field, closes #1483
2021-10-13 14:08:06 -07:00
Simon Willison
875117c343
Fix bug with ?_next=x&_sort=rowid, closes #1470
2021-10-09 18:14:56 -07:00
Simon Willison
adb5b70de5
Show count of facet values if ?_facet_size=max, closes #1423
2021-08-16 11:56:32 -07:00
Simon Willison
ca4f83dc7b
Rename config= to settings=, refs #1432
2021-08-12 18:10:36 -07:00
Simon Willison
e837095ef3
Column metadata, closes #942
2021-08-12 16:53:23 -07:00
Simon Willison
fc4846850f
New way of deriving named parameters using explain, refs #1421
2021-08-08 20:21:13 -07:00
Simon Willison
a390bdf9ce
Stop using firstresult=True on render_cell, refs #1425
...
See https://github.com/simonw/datasette/issues/1425#issuecomment-894883664
2021-08-08 17:38:42 -07:00
Simon Willison
3bb6409a6c
render_cell() can now return an awaitable, refs
2021-08-08 16:05:00 -07:00
Simon Willison
66e143c76e
New hide_sql canned query option, refs #1422
2021-08-06 22:17:36 -07:00
Simon Willison
dd5ee8e668
Removed some unused imports
...
I found these with:
flake8 datasette | grep unus
2021-07-15 23:26:12 -07:00
Simon Willison
a6c8e7fa4c
Big performance boost for faceting, closes #1394
2021-07-14 17:05:43 -07:00
Simon Willison
83f6799a96
searchmode: raw table metadata property, closes #1389
2021-07-10 11:33:08 -07:00
Simon Willison
4a3e8561ab
Default 405 for POST, plus tests
2021-06-23 15:40:09 -07:00
Simon Willison
d23a267138
Make request available to menu plugin hooks, closes #1371
2021-06-09 21:45:24 -07:00
Simon Willison
6e9b07be92
More inclusive language
2021-06-02 21:45:03 -07:00
Guy Freeman
0f41db1ba8
Avoid error sorting by relationships if related tables are not allowed
...
Refs #1306
2021-06-01 21:25:27 -07:00
Simon Willison
9552414e1f
Re-display user's query with an error message if an error occurs ( #1346 )
...
* Ignore _shape when returning errors
2021-06-01 20:46:20 -07:00
Simon Willison
0539bf0816
Don't execute facets/counts for _shape=array or object, closes #263
2021-06-01 19:53:00 -07:00
Simon Willison
a18e8641bc
Don't reflect nofacet=1 and nocount=1 in BLOB URLs, refs #1353
2021-06-01 15:35:33 -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
d1d06ace49
?_trac=1 for CSV, plus ?_nofacets=1 when rendering CSV
...
Closes #1351 , closes #1350
2021-06-01 08:49:50 -07:00
Simon Willison
c5ae1197a2
?_nofacets=1 option, closes #1350
2021-05-30 22:39:14 -04:00
Simon Willison
f7d3e76fb3
Facets now execute ignoring ?_col and ?_nocol, fixes #1345
2021-05-30 22:31:14 -04: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
2bd9d54b27
Fix Jinja warnings, closes #1338 , refs #1331
2021-05-23 18:41:50 -07: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
7a2ed9f8a1
Fixed bug with ?_sort= and ?_search=, closes #1214
2021-02-02 13:21:03 -08:00
Simon Willison
1600d2a3ec
Renamed /:memory: to /_memory, with redirects - closes #1205
2021-01-28 14:48:56 -08:00
Simon Willison
a5ede3cdd4
Fixed bug loading database called 'test-database (1).sqlite'
...
Closes #1181 .
Also now ensures that database URLs have special characters URL-quoted.
2021-01-24 21:13:05 -08:00
Simon Willison
07e1635615
All ?_ parameters now copied to hidden form fields, closes #1194
2021-01-24 19:10:10 -08:00
Miroslav Šedivý
a882d67962
Modernize code to Python 3.6+ ( #1158 )
...
* Compact dict and set building
* Remove redundant parentheses
* Simplify chained conditions
* Change method name to lowercase
* Use triple double quotes for docstrings
Thanks, @eumiro!
2020-12-23 09:04:32 -08:00
Simon Willison
810853c5f2
Use time.perf_counter() instead of time.time(), closes #1157
2020-12-21 13:49:14 -08:00
Simon Willison
ebc7aa287c
In-memory _schemas database tracking schemas of attached tables, closes #1150
2020-12-18 14:34:05 -08:00
Simon Willison
2c0aca4887
_header=off option for CSV export, closes #1133
2020-12-10 15:28:44 -08:00
Simon Willison
6000d1a724
Fix for combining ?_search_x and ?_searchmode=raw, closes #1134
2020-12-09 11:56:44 -08:00
Simon Willison
eae103a82b
Write errors to stderr, closes #1131
2020-12-04 21:21:11 -08:00
Simon Willison
a45a3dff3e
Fix for OPTIONS request against /db, closes #1100
2020-12-02 16:49:55 -08:00
Simon Willison
88ac538b41
transfer-encoding: chunked for DB downloads, refs #749
...
This should get >32MB downloads working on Cloud Run.
2020-12-02 15:47:37 -08:00
Simon Willison
49b6297fb7
Typo fix: messagge_is_html, closes #1118
2020-11-30 13:24:23 -08:00
Simon Willison
f2e2bfcdd9
Renamed datasette.config() to .setting(), closes #1107
2020-11-24 14:06:32 -08:00
Simon Willison
30e64c8d3b
Use f-strings in place of .format()
...
Code transformed like so:
pip install flynt
flynt .
black .
2020-11-15 15:24:22 -08:00
Simon Willison
253f2d9a3c
Use correct QueryInterrupted exception on row page, closes #1088
2020-11-11 20:36:44 -08:00
Simon Willison
2a981e2ac1
Blank foreign key labels now show as hyphens, closes #1086
2020-11-11 15:44:04 -08:00
Simon Willison
7b19492070
database_actions() plugin hook, closes #1077
2020-11-02 10:27:25 -08:00
Simon Willison
11eb1e026f
datasette.urls.table(..., format="json"), closes #1035
...
Also improved tests for datasette.urls and added format= to some other methods
2020-10-31 11:16:28 -07:00
Simon Willison
f0a740ac21
Remove load_plugin hook - closes #1073
...
Refs #1042
This reverts commit 81dea4b07a
.
2020-10-31 09:21:22 -07:00
Simon Willison
0cb29498c7
Fixed bug with python tests/fixtures.py
...
https://github.com/simonw/datasette/runs/1333357885?check_suite_focus=true
2020-10-30 10:54:47 -07:00
Simon Willison
81dea4b07a
load_template() plugin hook
...
Closes #1042
2020-10-30 10:47:18 -07:00
Simon Willison
222f79bb4c
debug-menu permission, closes #1068
...
Also added tests for navigation menu logic.
2020-10-30 08:41:57 -07:00
Simon Willison
2f7731e9e5
table_actions() plugin hook plus menu, closes #1066
...
Refs #690
2020-10-29 22:16:41 -07:00
Simon Willison
178b7e8749
.csv now links to .blob downloads
...
Closes #1063 , closes #1034
2020-10-29 15:47:32 -07:00
Simon Willison
78b3eeaad9
.blob output renderer
...
* _blob_hash= checking plus refactored to use new BadRequest class, refs #1050
* Replace BlobView with new .blob renderer, closes #1050
* .blob downloads on arbitrary queries, closes #1051
2020-10-29 15:01:38 -07:00
Simon Willison
89519f9a37
Fixed bug with download of BLOB null, refs #1050
2020-10-28 21:05:40 -07:00
Simon Willison
7d9fedc176
Cascading permissions for .db download, closes #1058
2020-10-27 20:15:41 -07:00
Simon Willison
c3aba4aa98
--cors for /name.db downloads, refs #1057
2020-10-27 13:39:57 -07:00
Simon Willison
5db7ae3ce1
Link to BLOB downloads, closes #1046
2020-10-24 17:13:14 -07:00
Simon Willison
5a15197960
/db/table/-/blob/pk/column.blob download URL, refs #1036
2020-10-24 16:09:18 -07:00
Simon Willison
091441a444
Fixed remaining places that needed datasette.urls, closes #1025
2020-10-19 22:21:19 -07:00
Simon Willison
0d1763fb2f
More datasette.urls usage, refs #1025
2020-10-19 21:24:47 -07:00
Simon Willison
310c3a3e05
New datasette.urls URL builders, refs #904
2020-10-19 17:33:59 -07:00
Simon Willison
a4def0b8db
Clearer _sort_by_desc comment
2020-10-19 15:37:43 -07:00
Simon Willison
f3a087a578
Edit SQL button on canned queries, closes #1019
2020-10-13 20:44:18 -07:00
Simon Willison
8f97b9b58e
datasette.client internal requests mechanism
...
Closes #943
* Datasette now requires httpx>=0.15
* Support OPTIONS without 500, closes #1001
* Added internals tests for datasette.client methods
* Datasette's own test mechanism now uses httpx to simulate requests
* Tests simulate HTTP 1.1 now
* Added base_url in a bunch more places
* Mark some tests as xfail - will remove that when new httpx release ships: #1005
2020-10-09 09:11:24 -07:00
Simon Willison
7249ac5ca0
Support OPTIONS without 500, closes #1001
2020-10-08 18:43:53 -07:00
Simon Willison
5a184a5d21
Display column type in column action menu, closes #993
...
Also added new documented db.table_column_details() introspection method.
2020-10-05 17:32:10 -07:00
Simon Willison
0f2626868b
Much improved column menu display logic, refs #981
...
* Menu links now take into account existing querystring
* No longer shows facet option for primary key columns
* Conditionally displays sort/sort-desc if already sorted
* Does not show facet option if already faceted by this
2020-09-30 16:01:37 -07:00
Simon Willison
448d13ea6b
Fix for MagicParameters error with no POST body, closes #967
2020-09-15 13:12:57 -07:00
Simon Willison
72ac2fd32c
JSON API for writable canned queries, closes #880
2020-09-14 14:23:18 -07:00
Simon Willison
896fce228f
Canned query writes support JSON POST body, refs #880
2020-09-14 13:18:15 -07:00
Simon Willison
ea340cf320
Correctly persist selected facets in hidden fields
...
Closes #963
2020-09-12 14:54:01 -07:00
Simon Willison
a648bb82ba
Upgrade to Black 20.8b1, closes #958
2020-09-02 15:24:55 -07:00
Simon Willison
26b2922f17
await_me_maybe utility function
2020-09-02 15:21:12 -07:00
Simon Willison
799ecae948
register_output_renderer can now return Response, closes #953
2020-08-27 21:02:50 -07:00
Simon Willison
41ddc19756
Docs now live at docs.datasette.io ( #937 )
2020-08-15 16:57:05 -07:00
Simon Willison
0748a65a22
Fixed content-disposition header on DB download, closes #909
2020-07-29 14:34:22 -07:00
Simon Willison
12c0bc09cc
/-/allow-debug tool, closes #908
2020-07-24 15:55:10 -07:00
Simon Willison
549b1c2063
New forbidden() plugin hook, closes #812
2020-06-30 21:17:38 -07:00
Simon Willison
d6e03b0430
Cascading view permissions, closes #832
...
- If you have table permission but not database permission you can now view the table page
- New BaseView.check_permissions() method
2020-06-30 16:40:50 -07:00
Simon Willison
51427323e6
Add message when user logs out, refs #840
2020-06-29 11:31:35 -07:00
Simon Willison
22d932fafc
/-/logout page for logging out of ds_actor cookie
...
Refs #840
2020-06-28 21:17:58 -07:00
Simon Willison
a8a5f81372
Made show_messages available to plugins, closes #864
2020-06-28 17:50:47 -07:00
Simon Willison
7ac4936cec
.add_message() now works inside plugins, closes #864
...
Refs #870
2020-06-28 17:25:35 -07:00
Simon Willison
4dad028432
BaseView.as_asgi is now .as_view, refs #870
2020-06-28 16:47:40 -07:00
Simon Willison
3bc2461c77
Refactored AsgiView into BaseView, refs #870
2020-06-28 16:06:30 -07:00
Simon Willison
a8bcafc177
Refactored out AsgiRouter, refs #870
2020-06-28 13:45:17 -07:00
Simon Willison
563f5a2d3a
Magic parameters for canned queries
...
Closes #842
Includes a new plugin hook, register_magic_parameters()
2020-06-27 19:58:16 -07:00
Simon Willison
28bb1c5189
csrftoken() now works with .render_template(), closes #863
2020-06-23 20:23:50 -07:00
Simon Willison
6c26345836
New plugin hook: canned_queries(), refs #852
2020-06-18 16:35:15 -07:00
Simon Willison
308bcc8805
Fixed test_permissions_debug
2020-06-11 17:25:12 -07:00
Simon Willison
29c5ff493a
view-instance permission for debug URLs, closes #833
2020-06-11 15:14:51 -07:00
Simon Willison
57e812d5de
ds_author cookie can now expire, closes #829
...
Refs https://github.com/simonw/datasette-auth-github/issues/62#issuecomment-642152076
2020-06-10 12:39:54 -07:00
Simon Willison
008e2f63c2
response.set_cookie(), closes #795
2020-06-09 15:19:37 -07:00
Simon Willison
eefeafaa27
Removed unused import
2020-06-09 07:09:39 -07:00
Simon Willison
49d6d2f7b0
allow_sql block to control execute-sql upermission in metadata.json, closes #813
...
Also removed the --config allow_sql:0 mechanism in favour of the new allow_sql block.
2020-06-08 17:05:44 -07:00
Simon Willison
799c5d5357
Renamed resource_identifier to resource, refs #817
2020-06-08 11:59:53 -07:00
Simon Willison
c9f1ec616e
Removed resource_type from permissions system, closes #817
...
Refs #811 , #699
2020-06-08 11:51:03 -07:00
Simon Willison
5598c5de01
Database list on index page respects table/view permissions, refs #811
2020-06-08 11:34:14 -07:00