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

Function bootOnce

apps/local/src/db/v1-v2-ledger.test.ts:143–164  ·  view source on GitHub ↗
(dbPath: string)

Source from the content-addressed store, hash-verified

141/** The boot sequence apps/local/src/executor.ts runs, minus the executor:
142 * v1 gate → fumadb DDL → ledger. Returns what each phase reported. */
143const bootOnce = async (dbPath: string) => {
144 const migration = await migrateLocalV1ToV2IfNeeded({
145 sqlitePath: dbPath,
146 tables: collectTables(),
147 namespace: "executor_local",
148 tenantId: TENANT,
149 });
150 const sqlite = await createSqliteFumaDb({
151 tables: collectTables(),
152 namespace: "executor_local",
153 path: dbPath,
154 });
155 const applied = await Effect.runPromise(
156 runSqliteDataMigrations(sqlite.client, localDataMigrations),
157 );
158 const ledger = await queryRows<{ name: string }>(
159 sqlite.client,
160 "SELECT name FROM data_migration ORDER BY name",
161 );
162 await sqlite.close();
163 return { migration, applied, ledger: ledger.map((row) => row.name) };
164};
165
166const expectV2WithContext7 = async (dbPath: string) => {
167 const client = await openLocalLibsql(dbPath);

Callers 1

Calls 5

createSqliteFumaDbFunction · 0.90
runSqliteDataMigrationsFunction · 0.90
collectTablesFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected