「Facebook でログイン」を使用したすべてのユーザーを検索

その機能を廃止したいと考えており、それがユーザーベースにどのような影響を与えるかを知りたいと考えています。それを確認する簡単な方法はありませんか?

There’s some discussion about this here

@david once your work consolidating is done, can you add a quick built-in report to data explorer that counts users per auth method. I think it can help make decisions in some cases.

Definitely :+1:. Once the new stuff is done we will also be able to report on “last used date”, which should be useful for deciding which methods are important.

これらの Data Explorer クエリは、これらのケースで役立ちます。


1. Facebook でログインしたユーザーのリスト

WITH target_user_ids AS (
    SELECT id
    FROM users
    WHERE staged = false
        AND active = true
        AND last_seen_at IS NOT NULL)

SELECT 
    provider_name,
    user_id,
    info->>'name' name_user,
    info->>'email' email_user,
    info->>'image' image_user
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
    AND provider_name = 'facebook'
provider_name user_id name email image
facebook 1 User1 user1@gmail.com https://graph.facebook.com/.../photo1.jpg
facebook 2 User2 user2@yahoo.com https://graph.facebook.com/.../photo2.jpg


2. 外部ログイン方式ごとのユーザーリスト

  • discord
  • facebook
  • github
  • google_oauth2
  • twitter

WITH target_user_ids AS (
    SELECT id
    FROM users
    WHERE staged = false
        AND active = true
        AND last_seen_at IS NOT NULL)

SELECT 
    provider_name,
    user_id,
    info->>'name' AS name,
    info->>'email' AS email,
    info->>'image' AS image
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)


3. 外部ログイン方式ごとのユーザー数

WITH target_user_ids AS (
    SELECT id
    FROM users
    WHERE staged = false
        AND active = true
        AND last_seen_at IS NOT NULL)

SELECT 
    provider_name,
    COUNT(user_id) AS qtd
FROM user_associated_accounts ua
WHERE user_id IN (SELECT id FROM target_user_ids)
GROUP BY provider_name
UNION
SELECT 
    'github', 
    COUNT(user_id)
FROM   github_user_infos
WHERE user_id IN (SELECT id FROM target_user_ids)
ORDER BY provider_name
provider_name qtd
discord 10
facebook 100
github 400
google_oauth2 500
twitter 200

これらのクエリを投稿していただきありがとうございます!2番目の回答で、私が持っていた質問に答えてくれました。

(キーワードブースト:oauthユーザーリスト、oauthユーザー検索)