SELECT u.id,
       a.id                          AS profileId,
       IFNULL(a.role, 'CUSTOMER')    AS role,
       IF(a.id IS NULL, FALSE, TRUE) AS isOauth,
       u.name,
       u.username,
       u.email,
       u.image,
       a.provider
FROM users u
         LEFT JOIN accounts a
                   ON a.user_id = u.id
WHERE u.id = ?
LIMIT 1;
