text: 'use strict'
  const mssql = require('./')
  
  const [, , max] = process.argv
  
  const sqlConfig = {
    password: 'P@ssw0rd',
    database: 'test',
    stream: false,
    // driver: 'msnodesqlv8',
    options: {
      trustServerCertificate: true,
      enableArithAbort: true,
      encrypt: true,
      abortTransactionOnError: false
    },
    pool: {
      max: max ? parseInt(max) : 10,
      min: 0
    },
    port: 1433,
    user: 'sa',
    server: 'localhost',
    arrayRowMode: true
  }
  
  mssql.connect(sqlConfig).then((pool) => {
    console.log('Connected to SQL server')
    const request = pool.request()
    request.stream = true
    request.on('error', (err) => {
      console.error('good', err)
    })
    return request.query('SELECT * FROM nontable')
  }).catch((err) => {
    console.error('bad', err)
  }).then(() => {
    console.log('Disconnecting from SQL server')
    return mssql.close()
  }).then(() => console.log('Disconnected'))
  