Skip to content

Commit e471db5

Browse files
committed
Keep FumaDB query context off SDK surface
1 parent 8925d2f commit e471db5

5 files changed

Lines changed: 7 additions & 19 deletions

File tree

apps/local/src/server/executor.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ import * as fs from "node:fs";
55
import { homedir } from "node:os";
66
import { basename, join } from "node:path";
77

8-
import {
9-
Scope,
10-
ScopeId,
11-
collectTables,
12-
createExecutor,
13-
type AnyPlugin,
14-
withQueryContext,
15-
} from "@executor-js/sdk";
8+
import { Scope, ScopeId, collectTables, createExecutor, type AnyPlugin } from "@executor-js/sdk";
9+
import { withQueryContext } from "fumadb/query";
1610
import { loadPluginsFromJsonc } from "@executor-js/config";
1711

1812
import executorConfig from "../../executor.config";

apps/local/src/server/sqlite-import.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { existsSync, mkdtempSync, rmSync } from "node:fs";
44
import { tmpdir } from "node:os";
55
import { join } from "node:path";
66

7-
import { collectTables, withQueryContext } from "@executor-js/sdk";
7+
import { collectTables } from "@executor-js/sdk";
8+
import { withQueryContext } from "fumadb/query";
89

910
import { importSqliteDataToFuma } from "./sqlite-import";
1011
import { createSqliteFumaDb, type SqliteFumaDb } from "./sqlite-fumadb";

packages/core/sdk/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export {
2020
// FumaDB integration.
2121
export { fumadb } from "fumadb";
2222
export type { FumaDB } from "fumadb";
23-
export { withQueryContext } from "fumadb/query";
2423
export type { AbstractQuery, Condition, ConditionBuilder } from "fumadb/query";
2524
export { column, idColumn, schema as fumaSchema, table } from "fumadb/schema";
2625
export type { AnyColumn, AnySchema, AnyTable, Column, Schema as FumaSchema } from "fumadb/schema";

packages/plugins/openapi/src/sdk/plugin.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
SetSecretInput,
2525
type InvokeOptions,
2626
type SecretProvider,
27-
withQueryContext,
2827
} from "@executor-js/sdk";
2928
import { memorySecretsPlugin } from "@executor-js/sdk/testing";
3029
import type { ConfigFileSink } from "@executor-js/config";
@@ -1178,9 +1177,7 @@ layer(TestLayer)("OpenAPI Plugin", (it) => {
11781177
plugins: [openApiPlugin(), memorySecretsPlugin()] as const,
11791178
});
11801179
const executor = yield* createExecutor(config);
1181-
const db = withQueryContext(config.db, {
1182-
allowedScopeIds: new Set([String(USER_SCOPE), String(ORG_SCOPE)]),
1183-
});
1180+
const db = config.db;
11841181

11851182
yield* executor.secrets.set(
11861183
SetSecretInput.make({

packages/plugins/workos-vault/src/sdk/secret-store.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
ScopeId,
1313
SecretId,
1414
SetSecretInput,
15-
withQueryContext,
1615
} from "@executor-js/sdk";
1716

1817
import {
@@ -328,7 +327,7 @@ const makeLayeredExecutors = (client: WorkOSVaultClient) =>
328327
createdAt: new Date(),
329328
});
330329

331-
const config = makeTestConfig({ scopes: [outerScope], plugins });
330+
const config = makeTestConfig({ scopes: [innerScope, outerScope], plugins });
332331
const execOuter = yield* createExecutor({ ...config, scopes: [outerScope] });
333332
const execInner = yield* createExecutor({ ...config, scopes: [innerScope, outerScope] });
334333
return { execOuter, execInner, outerId, innerId, config };
@@ -413,9 +412,7 @@ describe("WorkOS Vault secret provider — multi-scope isolation", () => {
413412

414413
const rows = toVaultMetadataRows(
415414
yield* Effect.promise(() =>
416-
withQueryContext(config.db, {
417-
allowedScopeIds: new Set([String(innerId), String(outerId)]),
418-
}).findMany("workos_vault_metadata", {
415+
config.db.findMany("workos_vault_metadata", {
419416
where: (b) => b("id", "=", "api-token"),
420417
}),
421418
),

0 commit comments

Comments
 (0)