Мне интересно, как бы я написал запрос в pg-prom, который возвращал бы данные из таблицы SQL обратно в эту структуру. Я считаю, что мне нужен вложенный массив объектов для каждого «id». Любая помощь или направления к документации будут оценены. Спасибо
````data,
````{
```"id": "1",
```"data": [
`````````{
`````````"x": "1",
`````````"y": 2
`````````},
`````````{
`````````"x": "2",
`````````"y": 2
`````````},
```"id": "2",
```"data": [
`````````{
`````````"x": "1",
`````````"y": 2
`````````},
`````````{
`````````"x": "2",
`````````"y": 2
`````````},
```"id": "3",
```"data": [
`````````{
`````````"x": "1",
`````````"y": 2
`````````},
`````````{
`````````"x": "2",
`````````"y": 2
`````````},
```"id": "4",
```"data": [
`````````{
`````````"x": "1",
`````````"y": 2
`````````},
`````````{
`````````"x": "2",
`````````"y": 2
`````````}
````````]
```````}
``````]