import pg from 'pg';
const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });
try {
  const r = await pool.query('SELECT count(*) FROM products');
  console.log('Products:', r.rows[0].count);
  const r2 = await pool.query('SELECT count(*) FROM product_offers WHERE in_stock = true');
  console.log('Active offers:', r2.rows[0].count);
} catch (e) {
  console.error('DB Error:', e.message);
} finally {
  await pool.end();
}
