* A value that differs whenever the database content may have changed * since the last call, whoever changed it: `total_changes()` counts the * rows this connection inserted, updated or deleted, and * `PRAGMA data_version` moves when any OTHER connection — another process's * sync, a CLI
()
| 1433 | * recompute, which only costs time, never a stale answer. |
| 1434 | */ |
| 1435 | private getChangeStamp(): string { |
| 1436 | if (!this.stmts.getChangeStamp) { |
| 1437 | this.stmts.getChangeStamp = this.db.prepare( |
| 1438 | 'SELECT total_changes() AS changes, (SELECT data_version FROM pragma_data_version) AS version' |
| 1439 | ); |
| 1440 | } |
| 1441 | const row = this.stmts.getChangeStamp.get() as { changes: number; version: number }; |
| 1442 | return `${row.changes}:${row.version}`; |
| 1443 | } |
| 1444 | |
| 1445 | private computeDominantFile(): { filePath: string; edgeCount: number; nextEdgeCount: number } | null { |
| 1446 | if (!this.stmts.getDominantFile) { |
no test coverage detected