I want to get all records with corresponding names as a JSON output. This solve partly my problem How to convert result table to JSON array in MySQL
SELECT JSON_ARRAYAGG(JSON_OBJECT('name', name, 'phone', phone)) from Person;
But instead of specifying names and records, I would like to get all of them, something like
SELECT JSON_ARRAYAGG(JSON_OBJECT(*, *)) from Person;
How can I achieve it?