redThread / debug_db.js
3v324v23's picture
Initial commit of RedThread project
0dd2082
raw
history blame contribute delete
459 Bytes
const { getDb } = require('./server/src/db/database');
async function debugDb() {
try {
const db = await getDb();
const rows = await db.all('SELECT name, city, lat, lon, scrapedAt FROM places ORDER BY scrapedAt DESC LIMIT 10');
console.log('--- LATEST ENTRIES ---');
console.table(rows);
} catch (err) {
console.error('Debug failed:', err.message);
} finally {
process.exit(0);
}
}
debugDb();