const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('hotel.db');

db.all("SELECT name FROM sqlite_master WHERE type='table'", [], (err, tables) => {
    console.log('Tables:', tables.map(t => t.name).join(', '));

    db.all("PRAGMA table_info(reviews)", [], (err, cols) => {
        console.log('reviews columns:', cols.map(c => c.name).join(', '));

        db.all("SELECT COUNT(*) as cnt FROM reviews", [], (err, rows) => {
            console.log('Reviews count:', rows && rows[0] ? rows[0].cnt : 0);
            db.close();
        });
    });
});