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

Function withDb

packages/core/sdk/src/subject-registry.test.ts:21–26  ·  view source on GitHub ↗
(body: (db: SqliteTestFumaDb) => Effect.Effect<A, E>)

Source from the content-addressed store, hash-verified

19const THROTTLE_MS = 60_000;
20
21const withDb = <A, E>(body: (db: SqliteTestFumaDb) => Effect.Effect<A, E>): Effect.Effect<A, E> =>
22 Effect.acquireUseRelease(
23 Effect.promise(() => createSqliteTestFumaDb({ tables: collectTables() })),
24 body,
25 (db) => Effect.promise(() => db.close()),
26 );
27
28// Read the way PR 1.3's readers will: through a tenant-bound query context.
29// `last_seen_at` is a bigint column stored as a SQLite blob, so a raw SQL read

Callers 1

Calls 3

createSqliteTestFumaDbFunction · 0.90
collectTablesFunction · 0.90
closeMethod · 0.65

Tested by

no test coverage detected