const { Pool } = require('pg'); const pool = new Pool({ connectionString: process.env.DATABASE_URL || 'postgresql://kelly:kelly@localhost:5432/hub' }); (async () => { try { const stats = await pool.query(` SELECT COUNT(*) as total, COUNT(*) FILTER (WHERE active = true) as active, COUNT(*) FILTER (WHERE active = false) as inactive, COUNT(*) FILTER (WHERE test_result = 'success') as passed, COUNT(*) FILTER (WHERE test_result = 'failed') as failed, COUNT(*) FILTER (WHERE test_result IS NULL) as untested FROM proxies `); const s = stats.rows[0]; console.log('\nšŸ“Š Proxy Statistics:'); console.log('='.repeat(60)); console.log(`Total Proxies: ${s.total}`); console.log(`Active: ${s.active} (passing tests)`); console.log(`Inactive: ${s.inactive} (failed tests)`); console.log(`Test Results:`); console.log(` āœ… Passed: ${s.passed}`); console.log(` āŒ Failed: ${s.failed}`); console.log(` ⚪ Untested: ${s.untested}`); process.exit(0); } catch (error) { console.error('Error:', error); process.exit(1); } })();