Also introduced a new mechanism for ensuring the --help examples in the
documentation reflect the current output of the --help commands, via a new
update-docs-help.sh script. Closes#336
I saw this error:
sanic.exceptions.RequestTimeout: Request Timeout
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/simonw/Dropbox/Development/datasette/venv/lib/python3.6/site-packages/sanic/handlers.py", line 82, in response
response = handler(request=request, exception=exception)
File "/Users/simonw/Dropbox/Development/datasette/datasette/app.py", line 512, in on_exception
if request.path.split("?")[0].endswith(".json"):
AttributeError: 'NoneType' object has no attribute 'path'
Strangely "if request and request.path..." did not work here, because the
Sanic Request class extends builtins.dict and hence evaluates to False if it
has no headers.
* table.csv?_stream=1 to download all rows - refs #266
This option causes Datasette to serve ALL rows in the table, by internally
following the _next= pagination links and serving everything out as a stream.
Also added new config option, allow_csv_stream, which can be used to disable
this feature.
* New config option max_csv_mb limiting size of CSV export
When a new tagged version is pushed, this should:
* bdist_wheel it and release to https://pypi.python.org/pypi/datasette
* Set an alias of v0-22-1.datasette.io for the deployed demo
If the tests pass in Travis CI, deploy an instance containing Datasette's test
fixtures to https://latest.datasette.io/
Also set up an alias of truncated-commit-hash.datasette.io
This is a relatively obscure new command-line argument that helps solve the
problem of showing accurate version information in deployed instances of
Datasette even if they were deployed directly from source code.
You can pass --version-note to datasette publish and package and it will then
in turn be passed to datasette when it starts:
datasette --version-note=hello fixtures.db
Now if you visit /-/versions.json you will see this:
{
"datasette": {
"note": "hello",
"version": "0+unknown"
},
"python": {
"full": "3.6.5 (default, Jun 6 2018, 19:19:24) \n[GCC 6.3.0 20170516]",
"version": "3.6.5"
},
...
}
I plan to use this in some Travis CI configuration, refs #313
The fixtures database created by our unit tests makes for a good "live" demo
of Datasette in action.
I've improved the metadata it ships with to better support this use-case.
I've also improved the mechanism for writing out fixtures: you can do this:
python tests/fixtures.py fixtures.db
To get just the fixtures database written out... or you can do this:
python tests/fixtures.py fixtures.db fixtures.json
To get metadata which you can then serve like so:
datasette fixtures.db -m fixtures.json
Refs #313