mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
simplified table stats
This commit is contained in:
parent
4c614aee90
commit
9f472b353a
@ -566,17 +566,15 @@ class ConsistencyChecks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
runDbDiagnostics() {
|
runDbDiagnostics() {
|
||||||
function showEntityStat(tableName) {
|
function getTableCount(tableName) {
|
||||||
const count = sql.getValue(`SELECT COUNT(1) FROM ${tableName}`);
|
const count = sql.getValue(`SELECT COUNT(1) FROM ${tableName}`);
|
||||||
|
|
||||||
log.info(`${tableName}: ${count}`);
|
return `${tableName}: ${count}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
showEntityStat("notes");
|
const tables = [ "notes", "note_revisions", "branches", "attributes", "api_tokens" ];
|
||||||
showEntityStat("note_revisions");
|
|
||||||
showEntityStat("branches");
|
log.info("Table counts: " + tables.map(tableName => getTableCount(tableName)).join(", "));
|
||||||
showEntityStat("attributes");
|
|
||||||
showEntityStat("api_tokens");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async runChecks() {
|
async runChecks() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user