Q: How to make a recursive query using Supabase? I use the Supabase database, in which I have a table with comments. I want to make a query that will return me a tree. Now the comments table looks like this (JSON):
{
  id: 1,
  value: "Hi, I'm the first comment"
  parent_id: null
},
{
  id: 2,
  value: "Hi, I am the answer to the first comment"
  parent_id: 1
},
{
  id: 3,
  value: "I am the answer to the answer"
  parent_id: 2
},
{
  id: 4,
  value: "I am the second comment"
  parent_id: null
}

How to make a Supabase query to get data in the form of a tree? I want to see this result:
{
  id: 1,
  value: "Hi, I'm the first comment"
  parent_id: null
  children: [
    {
      id: 2,
      value: "Hi, I am the answer to the first comment"
      parent_id: 1,
      children: [
        {
          id: 3,
          value: "I am the answer to the answer"
          parent_id: 2,
          children: []
        },
      ]
    }
  ]
},
{
  id: 4,
  value: "I am the second comment"
  parent_id: null,
  children: []
}

