Release v3.8.0 (#2073)

Integrated into release/v3.8.0
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-05-10 00:55:06 -03:00
committed by GitHub
parent 08e18867fd
commit 3d75fb3fae
726 changed files with 68560 additions and 10908 deletions

View File

@@ -0,0 +1,34 @@
import Database from 'better-sqlite3';
import path from 'path';
import os from 'os';
const SQLITE_FILE = path.join(process.cwd(), 'data', 'storage.sqlite');
console.log('Checking database at:', SQLITE_FILE);
const db = new Database(SQLITE_FILE, { readonly: true });
try {
const rows = db.prepare(`
SELECT api_key_id, api_key_name, COUNT(*) as count, MAX(timestamp) as last_used
FROM usage_history
GROUP BY api_key_id, api_key_name
ORDER BY count DESC
`).all();
console.log('Top Usage Entries:');
console.table(rows);
const keys = db.prepare(`
SELECT id, name, key_prefix, machine_id
FROM api_keys
`).all();
console.log('All API Keys:');
console.table(keys);
} catch (err) {
console.error('Error:', err.message);
} finally {
db.close();
}