Get query results into an array

Have you considered using the JSON data type that was recently added?