mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-27 04:49:49 -07:00
04095eebf7
Move snapshot/merge/quiescence engine and ssh helpers from launcher/sync into src/core/services/stats-sync, parameterized on a minimal SyncDb driver. The launcher binds it to bun:sqlite via launcher/sync/bun-driver; the sync command becomes a thin adapter over the shared sync flow.
32 lines
926 B
TypeScript
32 lines
926 B
TypeScript
// bun:sqlite bindings for the shared stats-sync engine. The engine itself
|
|
// lives in src/core/services/stats-sync so the Electron app (libsql) can run
|
|
// the exact same snapshot/merge code via its own driver.
|
|
import {
|
|
createDbSnapshot as createDbSnapshotWith,
|
|
createEmptyMergeSummary,
|
|
findLiveStatsDaemonPid,
|
|
nowDbTimestamp,
|
|
readSchemaVersion,
|
|
assertMergeableSchema,
|
|
insertRow,
|
|
tableExists,
|
|
SCHEMA_VERSION,
|
|
} from '../../src/core/services/stats-sync/shared.js';
|
|
import { openBunSyncDb } from './bun-driver.js';
|
|
|
|
export {
|
|
createEmptyMergeSummary,
|
|
findLiveStatsDaemonPid,
|
|
nowDbTimestamp,
|
|
readSchemaVersion,
|
|
assertMergeableSchema,
|
|
insertRow,
|
|
tableExists,
|
|
SCHEMA_VERSION,
|
|
};
|
|
export type { SyncMergeSummary } from '../../src/core/services/stats-sync/shared.js';
|
|
|
|
export function createDbSnapshot(dbPath: string, outPath: string): void {
|
|
createDbSnapshotWith(openBunSyncDb, dbPath, outPath);
|
|
}
|