Press J or click me!

Docs
Supabase

Supabase

Learn how to make supabase work with our boilerplate.
IMPORTANT FUNCTIONget_admin_permissions on service_role.
The following command gives users table permission to the service role.
1.GRANT SELECT ON TABLE auth.users TO service_role;
Supabase Function get_total_amount_of_users()
Supabase function in SQL editor that gets total users created.
1.CREATE OR REPLACE FUNCTION get_total_amount_of_users()2.RETURNS TABLE (total_users bigint)3.AS $$4.BEGIN5.RETURN QUERY SELECT COUNT(id) FROM auth.users;6.END;7.$$ LANGUAGE plpgsql;
Supabase Function get_user_id_by_email(email TEXT)
Supabase function in SQL editor that gets the user id by email.
1.CREATE OR REPLACE FUNCTION get_user_id_by_email(email TEXT)2.RETURNS TABLE (id uuid)3.AS $$4.BEGIN5.RETURN QUERY SELECT au.id FROM auth.users au WHERE au.email = $1;6.END;7.$$ LANGUAGE plpgsql;