Simon Willison
8252e71da4
Limit on max rows returned, controlled by --max_returned_rows option
...
If someone executes 'select * from table' against a table with a million rows
in it, we could run into problems: just serializing that much data as JSON is
likely to lock up the server.
Solution: we now have a hard limit on the maximum number of rows that can be
returned by a query. If that limit is exceeded, the server will return a
`"truncated": true` field in the JSON.
This limit can be optionally controlled by the new `--max_returned_rows`
option. Setting that option to 0 disables the limit entirely.
Closes #69
2017-11-13 11:33:01 -08:00
Simon Willison
26370b14d8
Handle table names with slashes in them
...
e.g. https://datasette-wdlexdiaoz.now.sh/fivethirtyeight-75d605c/bob-ross%2Felements-by-episode.csv?CABIN=1&BUSHES=1&CLOUDS=1
2017-11-12 15:17:00 -08:00
Simon Willison
666aa03253
Improved error handling
...
Invalid SQL now shows a special error.html template, and is covered by tests.
2017-11-12 13:16:15 -08:00
Simon Willison
ff2ab9dc7d
Views now show their SQL, are handled a bit better
...
Refs #66
2017-11-12 12:32:25 -08:00
Simon Willison
8acdc2fd14
Test for table with space in name
...
Tests code in b51836f846
2017-11-12 12:08:32 -08:00
Simon Willison
59580d02da
Implemented custom SQL via textarea
...
Closes #65
2017-11-11 18:35:35 -08:00
Simon Willison
fa42a56c6a
Bulked out table test a bit
...
I'm closing #50 - more tests will be added in the future, but the framework
is neatly in place for them now.
2017-11-11 14:22:47 -08:00
Simon Willison
e9e1def4c0
Revised JSON design a bit
...
Closes #63
2017-11-11 14:20:00 -08:00
Simon Willison
407795b612
Initial unit tests against our Sanic app
...
Refs #50
I had to disable the build metadata function to get these tests to work
sensibly. I need to completely rethink how that mechanism works.
2017-11-11 09:47:59 -08:00
Simon Willison
3280972c89
Fixed tests I broke earlier
...
Broke these tests in 21c9c04310
2017-11-11 08:52:17 -08:00
Simon Willison
21c9c04310
Implemented cursor-based pagination for table view
...
Closes #5
2017-11-10 12:41:14 -08:00
Simon Willison
a8a293cd71
Refactored util functions into new utils module
2017-11-10 11:25:54 -08:00
Simon Willison
40d3b3eae6
Refactored tests into new tests/ folder
...
Guided by https://docs.pytest.org/en/latest/goodpractices.html
2017-11-10 10:48:16 -08:00