4 ms·
I don't think you use a large response when there are other alternatives. One problem is see is with tests. You can expect that there are some problems that mig
by aliasEli 5y ago
I don't think you use a large response when there are other alternatives. One problem is see is with tests. You can expect that there are some problems that might arise with very large data sets, but it may take some computer time to set-up and break-down such tests.
- simonw 5y agoI've found writing tests against these endpoints to be pretty easy - I populate the associated database table with one record more than the default page size and then run a test that retrieves the full result and checks that the expected records are present. No need to run tests that generate 100MB responses every time - though I will do a few manual tests of large responses to check that RAM usage is as-expected. Here's my test in Datasette for the streaming CSV response - I already have a table with 1001 items in it setup for another test: https://github.com/simonw/datasette/blob/0.57.1/tests/test_csv.py#L155-L161 https://github.com/simonw/datasette/blob/0.57.1/tests/test_c...