mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
?_shape=arrayfirst, closes #287
This commit is contained in:
parent
b463f60158
commit
276913b748
3 changed files with 19 additions and 1 deletions
|
|
@ -433,6 +433,17 @@ def test_table_shape_arrays(app_client):
|
|||
] == response.json['rows']
|
||||
|
||||
|
||||
def test_table_shape_arrayfirst(app_client):
|
||||
response = app_client.get(
|
||||
'/test_tables.json?' + urllib.parse.urlencode({
|
||||
'sql': 'select content from simple_primary_key order by id',
|
||||
'_shape': 'arrayfirst'
|
||||
}),
|
||||
gather_request=False
|
||||
)
|
||||
assert ['hello', 'world', ''] == response.json
|
||||
|
||||
|
||||
def test_table_shape_objects(app_client):
|
||||
response = app_client.get(
|
||||
'/test_tables/simple_primary_key.json?_shape=objects',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue