title: NodeJs mssql connection returning undefined from .Request()
body: <p>I'm having trouble getting a working connection via nmp's mssql package. </p>
  
  <pre><code>Here's a quick look at my code:
  
  var sql = require('mssql');
  var sqlConfig = {
      user: 'NodeUser',
      password: 'test',
      server: '10.211.55.3',
      database: 'NodeJs'
  }
  sql.connect(sqlConfig, function(err){
      if(err != null)
          console.log(err);
  
      console.log(sql);
  });
  </code></pre>
  
  <p>Which seems to connect fine, but when I try to use it (in a route class):</p>
  
  <pre><code>var sql = require('mssql');
  
  bookRouter.route('/')
      .get(function(req, res){
          var req = sql.Request();
          req.query('select * from books', function(err, recordset){
              console.log(recordset);
          });
          res.render('BookListView', {
              title: 'Hello from Books',
              nav: nav,
              books: books
          });
      });
  </code></pre>
  
  <p>I get "TypeError: Cannot read property 'query' of undefined" on the req.query line. It seems like an issue with the connection? The only useful thing I could think to pull was the result of the "console.log(sql);" line above:</p>
  
  <pre><code>{ connect: [Function],
    close: [Function],
    on: [Function],
    Connection: 
     { [Function: Connection]
       EventEmitter: 
        { [Function: EventEmitter]
          EventEmitter: [Circular],
          usingDomains: false,
          defaultMaxListeners: [Getter/Setter],
          init: [Function],
          listenerCount: [Function] },
       usingDomains: false,
       defaultMaxListeners: 10,
       init: [Function],
       listenerCount: [Function],
       __super__: 
        EventEmitter {
          domain: undefined,
          _events: undefined,
          _maxListeners: undefined,
          setMaxListeners: [Function: setMaxListeners],
          getMaxListeners: [Function: getMaxListeners],
          emit: [Function: emit],
          addListener: [Function: addListener],
          on: [Function: addListener],
          once: [Function: once],
          removeListener: [Function: removeListener],
          removeAllListeners: [Function: removeAllListeners],
          listeners: [Function: listeners],
          listenerCount: [Function: listenerCount] } },
    Transaction: 
     { [Function: Transaction]
       EventEmitter: 
        { [Function: EventEmitter]
          EventEmitter: [Circular],
          usingDomains: false,
          defaultMaxListeners: [Getter/Setter],
          init: [Function],
          listenerCount: [Function] },
       usingDomains: false,
       defaultMaxListeners: 10,
       init: [Function],
       listenerCount: [Function],
       __super__: 
        EventEmitter {
          domain: undefined,
          _events: undefined,
          _maxListeners: undefined,
          setMaxListeners: [Function: setMaxListeners],
          getMaxListeners: [Function: getMaxListeners],
          emit: [Function: emit],
          addListener: [Function: addListener],
          on: [Function: addListener],
          once: [Function: once],
          removeListener: [Function: removeListener],
          removeAllListeners: [Function: removeAllListeners],
          listeners: [Function: listeners],
          listenerCount: [Function: listenerCount] } },
    Request: 
     { [Function: Request]
       EventEmitter: 
        { [Function: EventEmitter]
          EventEmitter: [Circular],
          usingDomains: false,
          defaultMaxListeners: [Getter/Setter],
          init: [Function],
          listenerCount: [Function] },
       usingDomains: false,
       defaultMaxListeners: 10,
       init: [Function],
       listenerCount: [Function],
       __super__: 
        EventEmitter {
          domain: undefined,
          _events: undefined,
          _maxListeners: undefined,
          setMaxListeners: [Function: setMaxListeners],
          getMaxListeners: [Function: getMaxListeners],
          emit: [Function: emit],
          addListener: [Function: addListener],
          on: [Function: addListener],
          once: [Function: once],
          removeListener: [Function: removeListener],
          removeAllListeners: [Function: removeAllListeners],
          listeners: [Function: listeners],
          listenerCount: [Function: listenerCount] } },
    Table: { [Function: Table] fromRecordset: [Function] },
    PreparedStatement: 
     { [Function: PreparedStatement]
       EventEmitter: 
        { [Function: EventEmitter]
          EventEmitter: [Circular],
          usingDomains: false,
          defaultMaxListeners: [Getter/Setter],
          init: [Function],
          listenerCount: [Function] },
       usingDomains: false,
       defaultMaxListeners: 10,
       init: [Function],
       listenerCount: [Function],
       __super__: 
        EventEmitter {
          domain: undefined,
          _events: undefined,
          _maxListeners: undefined,
          setMaxListeners: [Function: setMaxListeners],
          getMaxListeners: [Function: getMaxListeners],
          emit: [Function: emit],
          addListener: [Function: addListener],
          on: [Function: addListener],
          once: [Function: once],
          removeListener: [Function: removeListener],
          removeAllListeners: [Function: removeAllListeners],
          listeners: [Function: listeners],
          listenerCount: [Function: listenerCount] } },
    ConnectionError: 
     { [Function: ConnectionError]
       captureStackTrace: [Function: captureStackTrace],
       stackTraceLimit: 10,
       prepareStackTrace: undefined,
       __super__: [Error] },
    TransactionError: 
     { [Function: TransactionError]
       captureStackTrace: [Function: captureStackTrace],
       stackTraceLimit: 10,
       prepareStackTrace: undefined,
       __super__: [Error] },
    RequestError: 
     { [Function: RequestError]
       captureStackTrace: [Function: captureStackTrace],
       stackTraceLimit: 10,
       prepareStackTrace: undefined,
       __super__: [Error] },
    PreparedStatementError: 
     { [Function: PreparedStatementError]
       captureStackTrace: [Function: captureStackTrace],
       stackTraceLimit: 10,
       prepareStackTrace: undefined,
       __super__: [Error] },
    ISOLATION_LEVEL: 
     { READ_UNCOMMITTED: 1,
       READ_COMMITTED: 2,
       REPEATABLE_READ: 3,
       SERIALIZABLE: 4,
       SNAPSHOT: 5 },
    DRIVERS: [ 'msnodesql', 'tedious', 'tds', 'msnodesqlv8' ],
    TYPES: 
     { VarChar: [sql.VarChar],
       NVarChar: [sql.NVarChar],
       Text: [sql.Text],
       Int: [sql.Int],
       BigInt: [sql.BigInt],
       TinyInt: [sql.TinyInt],
       SmallInt: [sql.SmallInt],
       Bit: [sql.Bit],
       Float: [sql.Float],
       Numeric: [sql.Numeric],
       Decimal: [sql.Decimal],
       Real: [sql.Real],
       Date: [sql.Date],
       DateTime: [sql.DateTime],
       DateTime2: [sql.DateTime2],
       DateTimeOffset: [sql.DateTimeOffset],
       SmallDateTime: [sql.SmallDateTime],
       Time: [sql.Time],
       UniqueIdentifier: [sql.UniqueIdentifier],
       SmallMoney: [sql.SmallMoney],
       Money: [sql.Money],
       Binary: [sql.Binary],
       VarBinary: [sql.VarBinary],
       Image: [sql.Image],
       Xml: [sql.Xml],
       Char: [sql.Char],
       NChar: [sql.NChar],
       NText: [sql.NText],
       TVP: [sql.TVP],
       UDT: [sql.UDT],
       Geography: [sql.Geography],
       Geometry: [sql.Geometry],
       Variant: [sql.Variant] },
    MAX: 65535,
    map: 
     [ { js: [Function: String], sql: [sql.NVarChar] },
       { js: [Function: Number], sql: [sql.Int] },
       { js: [Function: Boolean], sql: [sql.Bit] },
       { js: [Function: Date], sql: [sql.DateTime] },
       { js: [Object], sql: [sql.VarBinary] },
       { js: [Object], sql: [sql.TVP] },
       register: [Function] ],
    fix: true,
    Promise: [Function: Promise],
    VarChar: [sql.VarChar],
    VARCHAR: [sql.VarChar],
    NVarChar: [sql.NVarChar],
    NVARCHAR: [sql.NVarChar],
    Text: [sql.Text],
    TEXT: [sql.Text],
    Int: [sql.Int],
    INT: [sql.Int],
    BigInt: [sql.BigInt],
    BIGINT: [sql.BigInt],
    TinyInt: [sql.TinyInt],
    TINYINT: [sql.TinyInt],
    SmallInt: [sql.SmallInt],
    SMALLINT: [sql.SmallInt],
    Bit: [sql.Bit],
    BIT: [sql.Bit],
    Float: [sql.Float],
    FLOAT: [sql.Float],
    Numeric: [sql.Numeric],
    NUMERIC: [sql.Numeric],
    Decimal: [sql.Decimal],
    DECIMAL: [sql.Decimal],
    Real: [sql.Real],
    REAL: [sql.Real],
    Date: [sql.Date],
    DATE: [sql.Date],
    DateTime: [sql.DateTime],
    DATETIME: [sql.DateTime],
    DateTime2: [sql.DateTime2],
    DATETIME2: [sql.DateTime2],
    DateTimeOffset: [sql.DateTimeOffset],
    DATETIMEOFFSET: [sql.DateTimeOffset],
    SmallDateTime: [sql.SmallDateTime],
    SMALLDATETIME: [sql.SmallDateTime],
    Time: [sql.Time],
    TIME: [sql.Time],
    UniqueIdentifier: [sql.UniqueIdentifier],
    UNIQUEIDENTIFIER: [sql.UniqueIdentifier],
    SmallMoney: [sql.SmallMoney],
    SMALLMONEY: [sql.SmallMoney],
    Money: [sql.Money],
    MONEY: [sql.Money],
    Binary: [sql.Binary],
    BINARY: [sql.Binary],
    VarBinary: [sql.VarBinary],
    VARBINARY: [sql.VarBinary],
    Image: [sql.Image],
    IMAGE: [sql.Image],
    Xml: [sql.Xml],
    XML: [sql.Xml],
    Char: [sql.Char],
    CHAR: [sql.Char],
    NChar: [sql.NChar],
    NCHAR: [sql.NChar],
    NText: [sql.NText],
    NTEXT: [sql.NText],
    TVP: [sql.TVP],
    UDT: [sql.UDT],
    Geography: [sql.Geography],
    GEOGRAPHY: [sql.Geography],
    Geometry: [sql.Geometry],
    GEOMETRY: [sql.Geometry],
    Variant: [sql.Variant],
    VARIANT: [sql.Variant],
    pool: { max: 10, min: 0, idleTimeoutMillis: 30000 },
    connection: { userName: '', password: '', server: '' },
    init: [Function] }
  </code></pre>
  
  <p>I can't help but notice the lack of credentials here. Any thoughts? Thanks.</p>