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

Function createExecutorFumaDb

packages/core/sdk/src/executor-fuma-db.ts:74–99  ·  view source on GitHub ↗
(
  drizzleDb: unknown,
  options: CreateExecutorFumaDbOptions<TTables>,
)

Source from the content-addressed store, hash-verified

72 * coupled to the caller's drizzle() construction.
73 */
74export 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`

Callers 5

createSqliteTestFumaDbFunction · 0.90
createDrizzleFumaDbFunction · 0.85
createD1ExecutorDbFunction · 0.85
createSqliteFumaDbFunction · 0.85
createSqliteExecutorDbFunction · 0.85

Calls 2

fumadbFunction · 0.90
drizzleAdapterFunction · 0.90

Tested by

no test coverage detected