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