Re:What if an SQL statement returned a database?
by eddd-ddde on Tuesday December 12, 2023 @08:38PM
(#38621560)
Personally, I prefer raw sql over something like an ORM. So many times I want to get all users, with all posts, with all post comments (example).
You can do an array aggregate to get all users and their posts in the array, with build_jsonb_object you can make the posts an object of say id and content. But then you can't really make another array aggregate per post.
You can do an array aggregate to get all users and their posts in the array, with build_jsonb_object you can make the posts an object of say id and content. But then you can't really make another array aggregate per post.