Simon Willison
1ec9c9995c
Backported default_allow_sql for 0.63.x, closes #1409
2023-01-05 09:21:07 -08:00
Simon Willison
64288d827f
Workaround for test failure: RuntimeError: There is no current event loop ( #1803 )
...
* Remove ensure_eventloop hack
* Hack to recover from intermittent RuntimeError calling asyncio.Lock()
2022-09-05 17:40:19 -07:00
Simon Willison
7d1e004ff6
Fix test I broke in #1744
2022-05-17 13:09:07 -07:00
Simon Willison
9979dcd07f
Also remove default_cache_ttl_hashed setting, refs #1661
2022-03-18 17:25:14 -07:00
Simon Willison
8658c66438
Show error if --setting hash_urls 1 used, refs #1661
2022-03-18 17:19:31 -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
0cd982fc6a
De-duplicate 'datasette db.db db.db', closes #1632
...
Refs https://github.com/simonw/datasette-publish-fly/pull/12
2022-02-07 15:28:59 -08:00
Simon Willison
e1770766ce
Return plugins and hooks in predictable order
2022-01-19 21:14:04 -08:00
Simon Willison
77f46297a8
Rename --help-config to --help-settings, closes #1431
2021-08-12 18:01:57 -07:00
Simon Willison
180c7a5328
--uds option for binding to Unix domain socket, closes #1388
2021-07-10 16:37:30 -07:00
Konstantin Baikov
8e18c79431
Use context manager instead of plain open ( #1211 )
...
Context manager with open closes the files after usage.
When the object is already a pathlib.Path i used read_text
write_text functions
In some cases pathlib.Path.open were used in context manager,
it is basically the same as builtin open.
Thanks, Konstantin Baikov!
2021-03-11 08:15:49 -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
36a44bffbf
Validation for --port, closes #1226
2021-02-18 10:05:27 -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
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
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
8919f99c2f
Improved .add_database() method design
...
Closes #1155 - _internal now has a sensible name
Closes #509 - Support opening multiple databases with the same stem
2020-12-22 12:04:18 -08:00
Simon Willison
fe86d85308
datasette serve --create option, closes #1135
2020-12-09 11:45:45 -08:00
Simon Willison
eae103a82b
Write errors to stderr, closes #1131
2020-12-04 21:21:11 -08:00
Simon Willison
4777362bf2
Work around CI bug with ensure_eventloop, refs #1115
2020-11-29 12:19:24 -08:00
Simon Willison
09033c08be
Suggest --load-extension=spatialite, closes #1115
2020-11-29 12:13:16 -08:00
Simon Willison
2a3d5b720b
Redirect /-/config to /-/settings, closes #1103
2020-11-24 12:19:14 -08:00
Simon Willison
3159263f05
New --setting to replace --config, closes #992
2020-11-24 12:01:47 -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
cefd058c1c
New explicit versioning mechanism
...
Closes #1054
2020-10-28 20:38:15 -07:00
Simon Willison
310c3a3e05
New datasette.urls URL builders, refs #904
2020-10-19 17:33:59 -07:00
Simon Willison
6aa5886379
--load-extension=spatialite shortcut, closes #1028
2020-10-19 15:37:43 -07:00
Simon Willison
7e70643852
Removed --debug option, which didn't do anything - closes #814
2020-10-10 16:39:38 -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
cac051bb8a
Fix for 'open' bug, closes #973
2020-09-22 08:39:48 -07:00
Simon Willison
a980199e61
New -o option for opening Datasette in your browser, closes #970
2020-09-22 07:26:47 -07:00
Simon Willison
ca5c405d0f
New 'datasette --pdb' option, closes #962
2020-09-11 11:37:55 -07:00
Simon Willison
69033c6ec4
datasette install --upgrade option, closes #945
2020-08-19 10:20:41 -07:00
Simon Willison
45414f8412
--get now calls startup() plugin hooks, closes #934
2020-08-15 13:52:41 -07:00
Simon Willison
e139a7619f
'datasette --get' option, closes #926
...
Also made a start on the datasette.utils.testing module, refs #898
2020-08-11 17:24:40 -07:00
Simon Willison
afdeda8216
Use runpy in install/uninstall, refs #928
2020-08-11 16:54:52 -07:00
Simon Willison
01fe5b7401
datasette install / datasette uninstall commands, closes #925
2020-08-11 15:32:06 -07:00
Simon Willison
09a3479a54
New "startup" plugin hook, closes #834
2020-06-13 10:55:41 -07:00
Simon Willison
abc7339124
Nicer pattern for make_app_client() in tests, closes #395
2020-06-07 14:14:10 -07:00
Simon Willison
75c143a84c
Fixed /-/plugins?all=1, refs #802
2020-06-05 16:55:08 -07:00
Simon Willison
f786033a5f
Fixed 'datasette plugins' command, with tests - closes #802
2020-06-05 16:46:37 -07:00
Simon Willison
9f3d4aba31
--root option and /-/auth-token view, refs #784
2020-05-31 18:16:42 -07:00
Simon Willison
fa27e44fe0
datasette.sign() and datasette.unsign() methods, refs #785
2020-05-31 18:16:42 -07:00
Simon Willison
6717c719dd
--metadata accepts YAML as well as JSON - closes #713
2020-04-02 12:30:53 -07:00
Simon Willison
21b57cdf9a
serve --inspect-file=X now populates cached table counts
...
Closes #462
2019-05-16 07:30:32 -07:00
Simon Willison
da0b3ce2b7
New run_sanity_checks mechanism, for SpatiLite
...
Moved VirtualSpatialIndex check into a new mechanism that should allow
us to add further sanity checks in the future.
To test this I've had to commit a binary sample SpatiaLite database to
the repository. I included a build script for creating that database.
Closes #466
2019-05-11 15:55:30 -07:00