Add getIndexStats function to db-operations

This function is required by the GitHub Actions workflow for
gathering database statistics after the build completes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
valknarness
2025-10-26 14:03:11 +01:00
parent 10910d8537
commit 6518cd8e76

View File

@@ -223,6 +223,15 @@ function getStats() {
};
}
function getIndexStats() {
const db = getDb();
return {
totalLists: db.prepare('SELECT COUNT(*) as count FROM awesome_lists').get().count,
totalRepositories: db.prepare('SELECT COUNT(*) as count FROM repositories').get().count,
totalReadmes: db.prepare('SELECT COUNT(*) as count FROM readmes').get().count
};
}
// Random
function getRandomRepository() {
const db = getDb();
@@ -256,5 +265,6 @@ module.exports = {
getSetting,
setSetting,
getStats,
getIndexStats,
getRandomRepository
};