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 checkColumns() {
    const { data, error } = await supabase.from('trade_history').select('*').limit(1);
    if (error) {
        console.error('Error fetching one row:', error);
    } else if (data && data.length > 0) {
        console.log('Trade History Columns:', Object.keys(data[0]));
    } else {
        console.log('Trade History is empty or table mismatch.');
    }
}

checkColumns();
