-
I have a postgresql table with definition
I have a static table component definition which must be redefined every time I add a new event to the table of events because the markdown fields are the event dates from the rows of the events Example:
I tried this dynamic component to create the definition above
However this query yields json with a single markdown field instead of multiple fields.
I suppose key names must be unique so is it possible to use the dynamic component for this purpose or is there another approach? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Repeated column names are interpreted by SQLPage as arrays. So you can directly use postgres json aggregation functions to build an array instead of repeating the column names. select
'table' as 'component',
json_agg(event_date) as markdown
from events; No need for the dynamic component here. Just good old sql. |
Beta Was this translation helpful? Give feedback.
As always - SQLPage has the answer! Thank you