Allows you to build JSON tree from SQL-query result