Your Question
Do we have the ability to do “preloading” in a single query? We can get data in a single query in the form of Postgresql lateral join (select Array(...query)). If Gorm supports this, it would be really perfect for me :)
Expected answer
select f.*, array_to_json(questions.list) from survey.forms f
left join lateral(
select Array(
select to_jsonb(*) from survey.form_items fi where fi.form_id = f.id
) as list
) questions on true;
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days