Returning simple JSON

This commit is contained in:
antoniocarlon 2018-05-09 11:36:24 +02:00
parent 4b128ea3e8
commit db637f6e52

View File

@ -182,7 +182,7 @@ BEGIN
_json_clause AS (SELECT
'SELECT ST_AsMVT(q, ''data'', $3) FROM (' ||
'SELECT ' || cdb_observatory.FIRST(cte_name) || '.mvtgeom geom,
to_JSONB(ARRAY[' || (SELECT String_Agg('val_' || colid, ', ') FROM _meta) || '])
to_JSONB(' || (SELECT String_Agg('val_' || colid, ', ') FROM _meta) || ')
FROM ' || String_Agg(cte_name, ', ') ||
Coalesce(' WHERE ' || val_joins, ') q')
AS json_clause