import { createClient } from '@supabase/supabase-js';
import * as dotenv from 'dotenv';
import path from 'path';

dotenv.config({ path: path.resolve(process.cwd(), '.env') });

const supabase = createClient(process.env.SUPABASE_URL!, process.env.SUPABASE_KEY!);

async function checkUsers() {
    console.log('Listing Users from DB...');
    const { data, error } = await supabase
        .from('users')
        .select('user_id, email, trade_enable');

    if (error) {
        console.error('❌ Error fetching users:', error);
    } else {
        console.log('✅ Users found:', data);
    }
}

checkUsers();
