History

remove scopeRoot / scopeName

Rhys Sullivan committed 7 months ago

Commit a7601031 parent 7dd9a5d10 files · +13 −45Browse files

Showing the changes to examples (3 of 10 files). Show all

Unified · Split

3 files
  1. examples/sqlite-sdk-consumer/README.md +0 −1
  2. examples/sqlite-sdk-consumer/src/main.ts +0 −2
  3. examples/sqlite-sdk-consumer/src/sqlite-backend.ts +6 −8
examples/sqlite-sdk-consumer/README.md+0−1
@@ -36,7 +36,6 @@ import { createSqliteExecutorBackend } from "@executor/sqlite-sdk-consumer-examp · 35 unmodified lines
36const executor = await createExecutor({36const executor = await createExecutor({
37 backend: createSqliteExecutorBackend({37 backend: createSqliteExecutorBackend({
38 databasePath: "./executor.sqlite",38 databasePath: "./executor.sqlite",
39 scopeName: "Acme",
40 }),39 }),
41});40});
42```41```
examples/sqlite-sdk-consumer/src/main.ts+0−2
@@ -8,8 +8,6 @@ const databasePath = process.env.DATABASE_PATH · 7 unmodified lines
8const executor = await createExecutor({8const executor = await createExecutor({
9 backend: createSqliteExecutorBackend({9 backend: createSqliteExecutorBackend({
10 databasePath,10 databasePath,
11 scopeName: "SQLite Example Workspace",
12 scopeRoot: process.cwd(),
13 }),11 }),
14});12});
15 13
examples/sqlite-sdk-consumer/src/sqlite-backend.ts+6−8
@@ -23,7 +23,7 @@ import type { · 22 unmodified lines
23 Execution,23 Execution,
24 ExecutionInteraction,24 ExecutionInteraction,
25 ExecutionStep,25 ExecutionStep,
26 LocalExecutorConfig,26 ExecutorScopeConfig,
27 LocalInstallation,27 LocalInstallation,
28 SecretMaterial,28 SecretMaterial,
29 SecretRef,29 SecretRef,
@@ -35,6 +35,9 @@ import { · 5 unmodified lines
35 SourceCatalogIdSchema,35 SourceCatalogIdSchema,
36 SourceCatalogRevisionIdSchema,36 SourceCatalogRevisionIdSchema,
37} from "@executor/platform-sdk/schema";37} from "@executor/platform-sdk/schema";
38import type {
39 SecretMaterialStoredDataRecord,
40} from "@executor/platform-sdk/runtime";
38import {41import {
39 contentHash,42 contentHash,
40 snapshotFromSourceCatalogSyncResult,43 snapshotFromSourceCatalogSyncResult,
@@ -42,8 +45,6 @@ import { · 1 unmodified line
42 45
43export type CreateSqliteExecutorBackendOptions = {46export type CreateSqliteExecutorBackendOptions = {
44 databasePath?: string;47 databasePath?: string;
45 scopeName?: string;
46 scopeRoot?: string | null;
47 scopeId?: string;48 scopeId?: string;
48 actorScopeId?: string;49 actorScopeId?: string;
49};50};
@@ -382,7 +383,7 @@ const createStorageDomains = ( · 332 unmodified lines
382 }383 }
383 : null;384 : null;
384 },385 },
385 upsert: (record: { secretId: SecretMaterial["id"]; data: unknown }) => {386 upsert: (record: SecretMaterialStoredDataRecord) => {
386 store.db.insert(secretMaterialStoredData).values({387 store.db.insert(secretMaterialStoredData).values({
387 secretId: record.secretId,388 secretId: record.secretId,
388 json: JSON.stringify(record.data),389 json: JSON.stringify(record.data),
@@ -568,8 +569,6 @@ export const createSqliteExecutorBackend = ( · 179 unmodified lines
568 569
569 return {570 return {
570 scope: {571 scope: {
571 scopeName: options.scopeName ?? "SQLite SDK Example",
572 scopeRoot: options.scopeRoot ?? null,
573 metadata: {572 metadata: {
574 kind: "sqlite",573 kind: "sqlite",
575 databasePath,574 databasePath,
@@ -601,7 +600,7 @@ export const createSqliteExecutorBackend = ( · 25 unmodified lines
601 load: () => {600 load: () => {
602 const row = store.db.select().from(scopeConfigs).where(eq(scopeConfigs.key, "project")).get();601 const row = store.db.select().from(scopeConfigs).where(eq(scopeConfigs.key, "project")).get();
603 const projectConfig = row602 const projectConfig = row
604 ? parseJson<LocalExecutorConfig>(row.projectConfigJson)603 ? parseJson<ExecutorScopeConfig>(row.projectConfigJson)
605 : {};604 : {};
606 return {605 return {
607 config: projectConfig,606 config: projectConfig,
@@ -618,7 +617,6 @@ export const createSqliteExecutorBackend = ( · 10 unmodified lines
618 set: { projectConfigJson: JSON.stringify(config) },617 set: { projectConfigJson: JSON.stringify(config) },
619 }).run();618 }).run();
620 },619 },
621 resolveRelativePath: ({ path, scopeRoot }) => resolvePath(scopeRoot, path),
622 },620 },
623 state: {621 state: {
624 load: () => {622 load: () => {