const { pool } = require('./src/db');
(async () => {
  var sites = ['first.com', 'exclusive-casino.com', 'forum.mr-gamble.com', 'fast-casino.com'];
  const r = await pool.query(
    'SELECT c.id, c.site_name, ca.casino_name FROM crawls c JOIN casinos ca ON ca.crawl_id = c.id WHERE c.site_name = $1 OR c.site_name = $2 ORDER BY c.id DESC LIMIT 30',
    [sites[0], sites[1]]
  );
  for (const row of r.rows) {
    console.log(row.id, '|', row.site_name.padEnd(20), '| #'+row.position, ':', row.casino_name);
  }
  await pool.end();
  process.exit(0);
})();
