Q195: a change reloads only what is not already shown, and the snapshot stops carrying records the window never reads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f79e4261f
commit
56eac39b1b
31 files changed
+146
-214
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
import { camel } from "../../src/main/services/snapshot-service";
|
||||
|
||||
/** A table's rows with camel-cased keys, for asserting backend records the app no longer ships to the window. */
|
||||
export function tableRows(db: DatabaseSync, table: string, orderBy: string, booleans: string[] = []): Array<Record<string, unknown>> {
|
||||
return (db.prepare(`select * from ${table} order by ${orderBy}`).all() as Array<Record<string, unknown>>).map((row) => {
|
||||
const next = camel(row as Record<string, string | number | null>);
|
||||
for (const key of booleans) next[key] = next[key] === 1;
|
||||
return next;
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user