const db = require('../src/db');

async function checkUser() {
    try {
        const result = await db.query("SELECT id, username, email, focus_area FROM users WHERE username LIKE 'jacob%' OR email LIKE 'jacob%' LIMIT 1");
        // Handle both mysql2 promise ([rows, fields]) and standard callback-style-promisified (rows)
        const rows = Array.isArray(result) && Array.isArray(result[0]) ? result[0] : result;
        
        console.log('User Data:', rows[0] || rows);
    } catch (err) {
        console.error('Error:', err.message);
    }
    process.exit(0);
}

checkUser();
