require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');

const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_SERVICE_KEY;
const supabase = createClient(supabaseUrl, supabaseKey);

async function testFunction() {
  try {
    const { error } = await supabase.rpc('exec_sql', { sql: 'SELECT 1' });
    if (error) {
      console.error('Error calling exec_sql:', error);
    } else {
      console.log('Successfully called exec_sql.');
    }
  } catch (error) {
    console.error('Error:', error);
  }
}

testFunction();
