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:
@@ -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
|
// Random
|
||||||
function getRandomRepository() {
|
function getRandomRepository() {
|
||||||
const db = getDb();
|
const db = getDb();
|
||||||
@@ -256,5 +265,6 @@ module.exports = {
|
|||||||
getSetting,
|
getSetting,
|
||||||
setSetting,
|
setSetting,
|
||||||
getStats,
|
getStats,
|
||||||
|
getIndexStats,
|
||||||
getRandomRepository
|
getRandomRepository
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user