In Postgres, either return nested json structures, or nested arrays. For an example see: https://shusson.info/post/building-nested-json-objects-with-...
Also supported by some ORMs like JOOQ: https://blog.jooq.org/nesting-collections-with-jooq-3-14s-sq...
In Postgres, either return nested json structures, or nested arrays. For an example see: https://shusson.info/post/building-nested-json-objects-with-...
Also supported by some ORMs like JOOQ: https://blog.jooq.org/nesting-collections-with-jooq-3-14s-sq...