From f49906ba7123895fa84216a0de19dd8ba7e11767 Mon Sep 17 00:00:00 2001 From: Brian Holmes Date: Thu, 14 Dec 2023 18:30:18 -0500 Subject: [PATCH] change schema initialization, rename variable in useAllModelColumns --- web-common/src/features/models/selectors.ts | 4 ++-- web-common/src/features/models/workspace/Editor.svelte | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web-common/src/features/models/selectors.ts b/web-common/src/features/models/selectors.ts index 0fbec1ba1d0..a8c27a8f7f5 100644 --- a/web-common/src/features/models/selectors.ts +++ b/web-common/src/features/models/selectors.ts @@ -51,8 +51,8 @@ export function useAllModelColumns( allModels.data.map((r) => createTableColumnsWithName(queryClient, instanceId, r.meta.name.name) ), - (sourceColumnResponses) => - sourceColumnResponses.filter((res) => !!res.data).map((res) => res.data) + (modelColumnResponses) => + modelColumnResponses.filter((res) => !!res.data).map((res) => res.data) ).subscribe(set); }); } diff --git a/web-common/src/features/models/workspace/Editor.svelte b/web-common/src/features/models/workspace/Editor.svelte index 75c61d356bf..2b9affc21f5 100644 --- a/web-common/src/features/models/workspace/Editor.svelte +++ b/web-common/src/features/models/workspace/Editor.svelte @@ -90,11 +90,11 @@ "select from where group by all having order limit sample unnest with window qualify values filter exclude replace like ilike glob as case when then else end in cast left join on not desc asc sum union", }); + const schema: { [table: string]: string[] } = {}; + // Autocomplete: source tables - let schema: { [table: string]: string[] }; $: allSourceColumns = useAllSourceColumns(queryClient, $runtime?.instanceId); $: if ($allSourceColumns?.length) { - schema = {}; for (const sourceTable of $allSourceColumns) { const sourceIdentifier = sourceTable?.tableName; schema[sourceIdentifier] =