kopia lustrzana https://github.com/simonw/datasette
shape_arrayfirst for query view
rodzic
6f903d5a98
commit
fdb141f622
|
@ -941,11 +941,17 @@ async def query_view(
|
|||
return {"ok": False, "error": str(error)}
|
||||
return [dict(r) for r in results.rows]
|
||||
|
||||
async def shape_arrayfirst(_results):
|
||||
results, error = _results
|
||||
if error:
|
||||
return {"ok": False, "error": str(error)}
|
||||
return [r[0] for r in results.rows]
|
||||
|
||||
shape_fn = {
|
||||
"arrays": shape_arrays,
|
||||
"objects": shape_objects,
|
||||
"array": shape_array,
|
||||
# "arrayfirst": shape_arrayfirst,
|
||||
"arrayfirst": shape_arrayfirst,
|
||||
# "object": shape_object,
|
||||
}[_shape or "objects"]
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue