( tables: FumaTables, )
| 54 | // out-of-band, so there is no schema bring-up here, and `close` is a no-op — |
| 55 | // `DbService.Live` owns the postgres connection lifecycle. |
| 56 | export const cloudDbProviderLayer = ( |
| 57 | tables: FumaTables, |
| 58 | ): Layer.Layer<DbProvider, never, DbService> => |
| 59 | Layer.effect(DbProvider)( |
| 60 | Effect.map(DbService.asEffect(), ({ db }): ExecutorDbHandle => { |
| 61 | const fuma = createDrizzleFumaDb({ |
| 62 | db, |
| 63 | tables, |
| 64 | namespace: CLOUD_NAMESPACE, |
| 65 | provider: "postgresql", |
| 66 | }); |
| 67 | return { |
| 68 | db: fuma.db, |
| 69 | fuma: fuma.fuma, |
| 70 | close: async () => {}, |
| 71 | // Plugin blobs (multi-MB resolved specs) live in R2, not Postgres. |
| 72 | // Guarded because test workers / local dev may run without the |
| 73 | // binding — the executor then falls back to the FumaDB `blob` table. |
| 74 | blobs: env.BLOBS ? makeR2BlobStore(env.BLOBS) : undefined, |
| 75 | }; |
| 76 | }), |
| 77 | ); |
no test coverage detected