<?php
require_once __DIR__ . '/../src/Utils/Env.php';
require_once __DIR__ . '/../src/Config/Database.php';

use App\Utils\Env;
use App\Config\Database;

Env::load(__DIR__ . '/../../.env');
$db = Database::getInstance()->getConnection();

echo "--- LAST 5 CONVERSATIONS ---\n";
$stmt = $db->query("SELECT * FROM conversations ORDER BY id DESC LIMIT 5");
print_r($stmt->fetchAll(PDO::FETCH_ASSOC));

echo "\n--- LAST 5 MESSAGES ---\n";
$stmt = $db->query("SELECT * FROM messages ORDER BY id DESC LIMIT 5");
print_r($stmt->fetchAll(PDO::FETCH_ASSOC));

echo "\n--- USERS ---\n";
$stmt = $db->query("SELECT id, username, display_name FROM users LIMIT 10");
print_r($stmt->fetchAll(PDO::FETCH_ASSOC));
