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;