
import { Sequelize } from 'sequelize';

const sequelize = new Sequelize('royal_enfield_onboarding', 'laxman', '<.efvP1D0^80Z)r5', {
    host: 'localhost',
    dialect: 'postgres',
    logging: false
});

const run = async () => {
    try {
        await sequelize.authenticate();
        console.log('Connected to database.');

        const [results] = await sequelize.query(`
            SELECT column_name, data_type 
            FROM information_schema.columns 
            WHERE table_name = 'interview_evaluations';
        `);
        console.log('Columns in interview_evaluations:');
        console.table(results);

        const [evals] = await sequelize.query('SELECT * FROM "interview_evaluations" ORDER BY "createdAt" DESC LIMIT 1;');
        console.log('Latest evaluation:');
        console.log(evals[0]);

        process.exit(0);
    } catch (error) {
        console.error('Error:', error);
        process.exit(1);
    }
};

run();
