Created
October 4, 2019 10:02
-
-
Save sdejean28/1ffa17cc078257313de0f7cd6602e80a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { sql, getPool } = require(“./mssql.js”); | |
var notifier = require(‘./notifier.js’) | |
notifier.on(‘mssql_connected’, () => { | |
notifier.emit(‘start_process’); | |
}) | |
notifier.on(‘mssql_connect_error’, () => { | |
console.log(‘Impossible to connect to mssql !’); | |
}) | |
/************************************************/ | |
notifier.on(‘start_process’, () => { | |
getPool().request() | |
.query(‘select count(*) from [test].[dbo].[TABLE]’, function(err, data) { | |
if(err) | |
{ console.log(‘query error >’,err); | |
throw err; | |
} | |
else { | |
console.log(‘query ok >’,data.recordset); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment