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

Function withDb

packages/core/sdk/src/subject-table.test.ts:19–26  ·  view source on GitHub ↗
(body: (db: SqliteTestFumaDb) => Promise<A>)

Source from the content-addressed store, hash-verified

17const OTHER_TENANT = "t2";
18
19const withDb = <A>(body: (db: SqliteTestFumaDb) => Promise<A>): Promise<A> =>
20 Effect.runPromise(
21 Effect.acquireUseRelease(
22 Effect.promise(() => createSqliteTestFumaDb({ tables: collectTables() })),
23 (db) => Effect.promise(() => body(db)),
24 (db) => Effect.promise(() => db.close()),
25 ),
26 );
27
28const insertSubject = (
29 db: SqliteTestFumaDb,

Callers 1

Calls 3

createSqliteTestFumaDbFunction · 0.90
collectTablesFunction · 0.90
closeMethod · 0.65

Tested by

no test coverage detected