include name of source with message

This commit is contained in:
fleetside72 2018-12-04 01:10:14 -05:00
parent 000ab2f865
commit 2e181d9257

View File

@ -62,7 +62,7 @@ server.post("/source", bodyParser.json(), function (inReq, inRes)// remove body
{ {
x = inReq.body; x = inReq.body;
var sql = "SELECT\ var sql = "SELECT\
jsonb_agg(x.message) message\ jsonb_agg(jsonb_build_object('name',d.def->>'name')||x.message) \
FROM\ FROM\
jsonb_array_elements($1::jsonb) d(def)\ jsonb_array_elements($1::jsonb) d(def)\
JOIN LATERAL tps.srce_set(d.def) x(message) ON TRUE"; JOIN LATERAL tps.srce_set(d.def) x(message) ON TRUE";