Skip to content

Commit c4cbaca

Browse files
feat: Add script to check the record count in the careers table of the SQLite database.
1 parent 7222dc2 commit c4cbaca

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

backend/scripts/checkCount.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const sqlite3 = require('sqlite3').verbose();
2+
const path = require('path');
3+
4+
const dbPath = path.join(__dirname, '../database/career_advisor.db');
5+
const db = new sqlite3.Database(dbPath);
6+
7+
console.log('Checking DB at:', dbPath);
8+
9+
db.get('SELECT count(*) as count FROM careers', (err, row) => {
10+
if (err) {
11+
console.error('Error:', err.message);
12+
} else {
13+
console.log(`Backend DB Count: ${row.count}`);
14+
}
15+
db.close();
16+
});

0 commit comments

Comments
 (0)