Update microsoftSqlServer.js

This commit is contained in:
Martin McKeaveney 2021-04-12 15:01:52 +01:00 committed by GitHub
parent 5993ae6242
commit 947da97d62
1 changed files with 28 additions and 0 deletions

View File

@ -37,6 +37,12 @@ const SCHEMA = {
read: { read: {
type: "sql", type: "sql",
}, },
update: {
type: "sql",
},
delete: {
type: "sql",
},
}, },
} }
@ -71,6 +77,28 @@ class SqlServerIntegration {
throw err 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 = { module.exports = {