const mysql = require('mysql2/promise');
const dotenv = require('dotenv');
const path = require('path');

dotenv.config({ path: 'c:/xampp/htdocs/hannoole/NESOS/backend/.env' });

async function checkUsers() {
  const connection = await mysql.createConnection({
    host: process.env.DB_HOST,
    user: process.env.DB_USER,
    password: process.env.DB_PASSWORD,
    database: process.env.DB_NAME,
    port: process.env.DB_PORT
  });

  const [rows] = await connection.execute('SELECT email, role, is_active FROM users');
  console.log('Users in DB:');
  console.log(JSON.stringify(rows, null, 2));
  await connection.end();
}

checkUsers().catch(console.error);
