( drizzleDb: unknown, options: CreateExecutorFumaDbOptions<TTables>, )
| 72 | * coupled to the caller's drizzle() construction. |
| 73 | */ |
| 74 | export const createExecutorFumaDb = <const TTables extends FumaTables>( |
| 75 | drizzleDb: unknown, |
| 76 | options: CreateExecutorFumaDbOptions<TTables>, |
| 77 | ): ExecutorFumaDb<TTables> => { |
| 78 | const latestSchema = fumaSchema({ |
| 79 | version: options.version, |
| 80 | tables: options.tables, |
| 81 | }); |
| 82 | const factory = fumadb({ |
| 83 | namespace: options.namespace, |
| 84 | schemas: [latestSchema], |
| 85 | }); |
| 86 | const fuma = factory.client( |
| 87 | drizzleAdapter({ |
| 88 | db: drizzleDb, |
| 89 | provider: options.provider, |
| 90 | interactiveTransactions: options.interactiveTransactions, |
| 91 | maxBoundParameters: options.maxBoundParameters, |
| 92 | }), |
| 93 | ); |
| 94 | |
| 95 | return { |
| 96 | db: fuma.orm(options.version), |
| 97 | fuma, |
| 98 | }; |
| 99 | }; |
| 100 | |
| 101 | // The uniform handle each host exposes through the `DbProvider` Layer (defined |
| 102 | // in the host layer). The `db`/`fuma` come from `createExecutorFumaDb`; `close` |
no test coverage detected