1
0
Fork 0
mirror of synced 2024-10-05 20:44:47 +13:00

Add info to query result payload (#10291)

This commit is contained in:
melohagan 2023-04-24 12:03:02 +01:00 committed by GitHub
parent 5f883ec42c
commit 5e76a50b0b

View file

@ -245,7 +245,7 @@ async function execute(
} }
const runFn = () => Runner.run(inputs) const runFn = () => Runner.run(inputs)
const { rows, pagination, extra } = await quotas.addQuery(runFn, { const { rows, pagination, extra, info } = await quotas.addQuery(runFn, {
datasourceId: datasource._id, datasourceId: datasource._id,
}) })
// remove the raw from execution incase transformer being used to hide data // remove the raw from execution incase transformer being used to hide data
@ -255,7 +255,7 @@ async function execute(
if (opts && opts.rowsOnly) { if (opts && opts.rowsOnly) {
ctx.body = rows ctx.body = rows
} else { } else {
ctx.body = { data: rows, pagination, ...extra } ctx.body = { data: rows, pagination, ...extra, ...info }
} }
} catch (err) { } catch (err) {
ctx.throw(400, err) ctx.throw(400, err)