I have the following SQL:
select array_to_json(array_agg(row_to_json(t))) from ( select username, notifications from useraccountview where username = \'Bobby