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

Function assertAllowedTable

packages/core/sdk/src/fuma-runtime.ts:117–124  ·  view source on GitHub ↗
(tables: ReadonlySet<string> | undefined, table: PropertyKey)

Source from the content-addressed store, hash-verified

115 tables === undefined || (typeof table === "string" && tables.has(table));
116
117const assertAllowedTable = (tables: ReadonlySet<string> | undefined, table: PropertyKey): void => {
118 if (isAllowedTable(tables, table)) return;
119 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: plugin-facing FumaDB facade rejects unavailable tables synchronously before query execution
120 throw new StorageError({
121 message: `FumaDB table "${String(table)}" is not available through this storage boundary.`,
122 cause: undefined,
123 });
124};
125
126const makeSafeFumaQuery = <TSchema extends AnySchema>(
127 db: FumaDb<TSchema>,

Callers 1

tableFunction · 0.85

Calls 1

isAllowedTableFunction · 0.85

Tested by

no test coverage detected