Skip to content

Instantly share code, notes, and snippets.

@jinalshah999
Created January 30, 2021 11:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jinalshah999/8df9a1940f5bbde6734bd7e78b5bdf8f to your computer and use it in GitHub Desktop.
Save jinalshah999/8df9a1940f5bbde6734bd7e78b5bdf8f to your computer and use it in GitHub Desktop.
const sql = require('mssql');
class MSSqlconnection {
async getConnection(dbConfig) {
try {
return await sql.connect({
user: dbConfig.user,
password: dbConfig.password,
server: dbConfig.server,
database: dbConfig.database,
port: dbConfig.port,
});
}
catch(error) {
}
module.exports = new MSSqlconnection();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment