MCPcopy
hub / github.com/CapSoftware/Cap / Database

Class Database

packages/web-backend/src/Database.ts:7–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5export type DbClient = ReturnType<typeof db>;
6
7export class Database extends Effect.Service<Database>()("Database", {
8 effect: Effect.gen(function* () {
9 return {
10 use: <T>(cb: (_: DbClient) => Promise<T>) =>
11 Effect.tryPromise({
12 try: () => cb(db()),
13 catch: (cause) => new DatabaseError({ cause }),
14 }),
15 };
16 }),
17}) {}

Callers

nothing calls this directly

Calls 1

dbFunction · 0.90

Tested by

no test coverage detected