From 8e756ccf848943a07526f929fc288ab9775507bb Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Tue, 26 Nov 2024 17:09:32 +0000 Subject: [PATCH] Type checks pass. --- .../server/src/integrations/tests/sqlAlias.spec.ts | 8 +++----- .../server/src/sdk/app/tables/external/index.ts | 13 +++---------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/packages/server/src/integrations/tests/sqlAlias.spec.ts b/packages/server/src/integrations/tests/sqlAlias.spec.ts index 739d3a4aee..66340bc794 100644 --- a/packages/server/src/integrations/tests/sqlAlias.spec.ts +++ b/packages/server/src/integrations/tests/sqlAlias.spec.ts @@ -7,6 +7,7 @@ import { Table, TableSourceType, SqlClient, + EnrichedQueryJson, } from "@budibase/types" import { sql } from "@budibase/backend-core" import { join } from "path" @@ -35,8 +36,8 @@ describe("Captures of real examples", () => { const relationshipLimit = 500 const primaryLimit = 100 - function getJson(name: string): QueryJson { - return require(join(__dirname, "sqlQueryJson", name)) as QueryJson + function getJson(name: string) { + return require(join(__dirname, "sqlQueryJson", name)) as EnrichedQueryJson } describe("create", () => { @@ -252,9 +253,6 @@ describe("Captures of real examples", () => { resource: { fields, }, - meta: { - table: TABLE, - }, } } diff --git a/packages/server/src/sdk/app/tables/external/index.ts b/packages/server/src/sdk/app/tables/external/index.ts index 941d193b94..5d8f03a7a6 100644 --- a/packages/server/src/sdk/app/tables/external/index.ts +++ b/packages/server/src/sdk/app/tables/external/index.ts @@ -241,19 +241,12 @@ export async function save( } const operation = tableId ? Operation.UPDATE_TABLE : Operation.CREATE_TABLE - await makeTableRequest( - datasource, - operation, - tableToSave, - tables, - oldTable, - opts?.renaming - ) + await makeTableRequest(datasource, operation, tableToSave, opts?.renaming) // update any extra tables (like foreign keys in other tables) for (let extraTable of extraTablesToUpdate) { const oldExtraTable = oldTables[extraTable.name] let op = oldExtraTable ? Operation.UPDATE_TABLE : Operation.CREATE_TABLE - await makeTableRequest(datasource, op, extraTable, tables, oldExtraTable) + await makeTableRequest(datasource, op, extraTable) } // make sure the constrained list, all still exist @@ -292,7 +285,7 @@ export async function destroy(datasourceId: string, table: Table) { const operation = Operation.DELETE_TABLE if (tables) { - await makeTableRequest(datasource, operation, table, tables) + await makeTableRequest(datasource, operation, table) cleanupRelationships(table, tables, { deleting: true }) delete tables[table.name] datasource.entities = tables