From 85f8229ef4a24edf864f8014fc0999610c849949 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 12 Apr 2021 15:01:52 +0100 Subject: [PATCH] Update microsoftSqlServer.js --- .../src/integrations/microsoftSqlServer.js | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/server/src/integrations/microsoftSqlServer.js b/packages/server/src/integrations/microsoftSqlServer.js index eea67a7256..ea26b6a2a7 100644 --- a/packages/server/src/integrations/microsoftSqlServer.js +++ b/packages/server/src/integrations/microsoftSqlServer.js @@ -37,6 +37,12 @@ const SCHEMA = { read: { type: "sql", }, + update: { + type: "sql", + }, + delete: { + type: "sql", + }, }, } @@ -71,6 +77,28 @@ class SqlServerIntegration { throw err } } + + async update(query) { + try { + await this.connect() + const response = await this.client.query(query.sql) + return response.recordset + } catch (err) { + console.error("Error querying MS SQL Server", err) + throw err + } + } + + async delete(query) { + try { + await this.connect() + const response = await this.client.query(query.sql) + return response.recordset + } catch (err) { + console.error("Error querying MS SQL Server", err) + throw err + } + } } module.exports = {