<?php
require __DIR__ . '/../bootstrap.php';

use Gestoreasy\Core\Tenant\ConnectionManager;

$tenant = $argv[1] ?? 'default';
$limit = max(1, (int)($argv[2] ?? 5));
$pdo = ConnectionManager::forTenant($tenant);
$stmt = $pdo->query("SELECT id, nome, email FROM suppliers ORDER BY id ASC LIMIT $limit");
$rows = $stmt->fetchAll();
echo json_encode($rows);
echo "\n";