import { pool } from './db.js';

async function verifyTags() {
    console.log('🔍 Checking job_tags table...');
    try {
        const res = await pool.query('SELECT category, COUNT(*) as count FROM job_tags GROUP BY category');
        if (res.rows.length === 0) {
            console.log('⚠️  No tags found in database.');
        } else {
            console.log('✅ Tags found:');
            console.table(res.rows);

            const total = await pool.query('SELECT COUNT(*) FROM job_tags');
            console.log(`Total tags: ${total.rows[0].count}`);
        }
    } catch (err) {
        console.error('❌ Error checking tags:', err.message);
    } finally {
        await pool.end();
    }
}

verifyTags();
