mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
New ?_sql_time_limit_ms=10 argument to database and table page
Allows callers to opt for a lower time limit. Closes #95
This commit is contained in:
parent
0b8c1b0a6d
commit
9cb69cbd45
2 changed files with 31 additions and 4 deletions
|
|
@ -101,6 +101,18 @@ def test_sql_time_limit(app_client):
|
|||
assert 'interrupted' == response.json['error']
|
||||
|
||||
|
||||
def test_custom_sql_time_limit(app_client):
|
||||
_, response = app_client.get(
|
||||
'/test_tables.jsono?sql=select+sleep(0.01)'
|
||||
)
|
||||
assert 200 == response.status
|
||||
_, response = app_client.get(
|
||||
'/test_tables.jsono?sql=select+sleep(0.01)&_sql_time_limit_ms=5'
|
||||
)
|
||||
assert 400 == response.status
|
||||
assert 'interrupted' == response.json['error']
|
||||
|
||||
|
||||
def test_invalid_custom_sql(app_client):
|
||||
_, response = app_client.get(
|
||||
'/test_tables?sql=.schema'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue