From dafa20ce47f6619985f95c75bd1fce2e53bc770a Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 Apr 2024 11:20:11 +0200 Subject: [PATCH 1/2] Add platform docs to mssql docker-compose --- packages/server/scripts/integrations/mssql/docker-compose.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/scripts/integrations/mssql/docker-compose.yaml b/packages/server/scripts/integrations/mssql/docker-compose.yaml index 89222eddaa..0f10eee456 100644 --- a/packages/server/scripts/integrations/mssql/docker-compose.yaml +++ b/packages/server/scripts/integrations/mssql/docker-compose.yaml @@ -4,6 +4,7 @@ services: # user: sa # database: master mssql: + # platform: linux/amd64 image: bb/mssql build: context: . From 642f30416a19eae3c36882b469459720a749ac7b Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 18 Apr 2024 16:40:43 +0200 Subject: [PATCH 2/2] Fix schema and aliasing usage --- packages/server/src/integrations/base/sql.ts | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index a8d746add9..28b7eb910b 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -472,14 +472,13 @@ class InternalBuilder { ): Knex.QueryBuilder { const tableName = endpoint.entityId const tableAlias = aliases?.[tableName] - let table: string | Record = tableName - if (tableAlias) { - table = { [tableAlias]: tableName } - } - let query = knex(table) - if (endpoint.schema) { - query = query.withSchema(endpoint.schema) - } + + const query = knex( + this.tableNameWithSchema(tableName, { + alias: tableAlias, + schema: endpoint.schema, + }) + ) return query }