How can I connect to SQL Server or SQL Azure from node.js when running on Linux.
The drivers I found on npm all need Windows + VS2005. Is there anyway to access SQL Server from Linux?
The mssql package in nodejs can adapt to next drivers:
I found a working solution, just using 'tedious' directly.
var Connection = require('tedious').Connection;
var config = {
userName: 'myuser@servername',
password: 'mypassword',
server: 'servername.database.windows.net',
// If you're on Windows Azure, you will need this:
options: {
encrypt: true
}
};
var connection = new Connection(config);
connection.on('connect', function(err) {
if(err)
console.log(err)
else
console.log('works!!!!!')
});