MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / writeLiveWalMarker

Function writeLiveWalMarker

apps/local/src/db/v1-v2-migration.test.ts:866–881  ·  view source on GitHub ↗
(path: string, marker: string)

Source from the content-addressed store, hash-verified

864};
865
866const writeLiveWalMarker = async (path: string, marker: string): Promise<void> => {
867 const client = await openLocalLibsql(path);
868 // oxlint-disable-next-line executor/no-try-catch-or-throw -- test DB adapter boundary: close the SQLite client even when marker setup fails
869 try {
870 await client.execute("PRAGMA journal_mode=WAL");
871 await client.execute("PRAGMA wal_autocheckpoint=0");
872 await client.execute("CREATE TABLE IF NOT EXISTS wal_marker (id text PRIMARY KEY, value text)");
873 await client.execute({
874 sql: "INSERT INTO wal_marker (id, value) VALUES (?, ?)",
875 args: [marker, "x".repeat(4096)],
876 });
877 } finally {
878 client.close();
879 }
880 expect(sqliteWalSize(path)).toBeGreaterThan(0);
881};
882
883const assertWalMarkerRows = async (input: { readonly path: string; readonly marker: string }) => {
884 expect(existsSync(input.path)).toBe(true);

Callers 1

Calls 4

openLocalLibsqlFunction · 0.90
sqliteWalSizeFunction · 0.85
executeMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected