Re: for json path, for json auto
Thank you, thank you!
I was able to make the following work, which is much easier than loading up a class and outputting it as json:
SELECT JSON_ARRAYAGG(JSON_OBJECT(
'id', id,
'account', account,
'token', token,
'scope', scope,
'added', added,
'expires_in', expires_in)) FROM auth;
If anyone else sees this and happens to know of a way to make it work without having to specifying the label along with the value, since I'm always wanting the label to be the same as the value, please feel free to share. I'd really prefer to not have to specify anything but rather just convert the results to JSON automatically... seems like it would be a common ask.