Connect to a SQL Server Database

Connect to a SQL Server database and run dynamic scripts through that library. The library is responsible for connecting to the database, executing the script and closing the connection after execution.

const sqlserver = require('linkapi-sdk/state/sql-server');

const config = {
  credentials: {
    "user": "",
    "password": "",
    "server": "",
    "database": "",
    "port": "",
  },
  enableArithAbort: false, // default false
  requestTimeout: 1000
}

const query = 'SELECT * FROM {{table}}';

const queryValues = {
  table: 'PRODUCTS'
};

const result = await sqlserver.execute(config);