Allow WITH query (previously we required SELECT at start)

Fixes #161
This commit is contained in:
Simon Willison 2017-12-03 20:51:31 -08:00
commit 0cfd7ce59d
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
3 changed files with 18 additions and 6 deletions

View file

@ -181,14 +181,14 @@ def test_invalid_custom_sql(app_client):
gather_request=False
)
assert response.status == 400
assert 'Statement must begin with SELECT' in response.text
assert 'Statement must be a SELECT' in response.text
response = app_client.get(
'/test_tables.json?sql=.schema',
gather_request=False
)
assert response.status == 400
assert response.json['ok'] is False
assert 'Statement must begin with SELECT' == response.json['error']
assert 'Statement must be a SELECT' == response.json['error']
def test_table_page(app_client):