From 6518cd8e76c93c1bb4a78d3b92d2eb9e23de7c27 Mon Sep 17 00:00:00 2001 From: valknarness Date: Sun, 26 Oct 2025 14:03:11 +0100 Subject: [PATCH] Add getIndexStats function to db-operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/db-operations.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/db-operations.js b/lib/db-operations.js index 3781c9c..3c0aa44 100644 --- a/lib/db-operations.js +++ b/lib/db-operations.js @@ -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 };