-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck-stats.js
More file actions
43 lines (34 loc) · 1.15 KB
/
Copy pathcheck-stats.js
File metadata and controls
43 lines (34 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env node
import pkg from 'pg';
const { Pool } = pkg;
// Configuration de la base de données
const pool = new Pool({
host: 'localhost',
port: 5432,
database: 'housy_tunisia',
user: 'postgres',
password: '0000',
ssl: false
});
async function checkStats() {
try {
console.log('📊 Vérification des statistiques actuelles...');
// Propriétés
const propertiesResult = await pool.query('SELECT COUNT(*) FROM real_estate_market');
console.log(`🏠 Propriétés: ${propertiesResult.rows[0].count}`);
// Matériaux
const materialsResult = await pool.query('SELECT COUNT(*) FROM materials');
console.log(`🔨 Matériaux: ${materialsResult.rows[0].count}`);
// Projets
const projectsResult = await pool.query('SELECT COUNT(*) FROM projects');
console.log(`📋 Projets: ${projectsResult.rows[0].count}`);
// Utilisateurs
const usersResult = await pool.query('SELECT COUNT(*) FROM users');
console.log(`👥 Utilisateurs: ${usersResult.rows[0].count}`);
} catch (error) {
console.error('❌ Erreur:', error.message);
} finally {
await pool.end();
}
}
checkStats();