Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

donaldaverill/meteor-package-tedious-connection-pool

Repository files navigation

Build Status

meteor add fourquet:tedious-connection-pool

tedious-connection-pool npm module wrapped for Meteor. Used for connection pooling with Microsoft SQL Server and Azure databases. Depends on fourquet:tedious.

For more, see the tedious Documentation.

Example:

var connectionPool = new TediousConnectionPool({
  max: 10,
  min: 0,
  idleTimeoutMillis: 30000
}, {
  userName: '[email protected]',
  password: 'password',
  server: 'something.database.windows.net',
  options: {
    encrypt: true,
    database: 'someDatabase'
  }
});

connectionPool.acquire(function (err, connection) {
  var request = new Tedious.Request('SELECT TOP 20 * FROM dbo.SomeTable',
    function (
      err,
      rowCount) {

      if (err) {
        console.log(err);
      } else {
        console.log(rowCount + ' rows');
      }
      connection.release();
    });

  request.on('row', function (columns) {
    var r = '';
    columns.forEach(function (column) {
      r = r + ' ' + column.value;
    });
    console.log('\n ', r);
  });

  connection.execSql(request);
});

Version

0.3.9_1

####License MIT

About

tedious-connection-pool npm package wrapped for Meteor

Resources

License

Stars

Watchers

Forks

Packages

No packages published