How to use the msnodesqlv8.close function in msnodesqlv8

To help you get started, we’ve selected a few msnodesqlv8 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TimelordUK / node-sqlserver-v8 / samples / javascript / simple-http.js View on Github external
console.log('>> test')
  const sqlOpen = toPromise(sql.open)
  try {
    console.log('sqlOpen ....')
    const connection = await sqlOpen(connectionString)
    console.log('..... sqlOpen')
    const connectionQuery = toPromise(connection.queryRaw)
    try {
      const d = new Date()
      console.log('connectionQuery 1 ....')
      const data = await connectionQuery(query)
      console.log('... connectionQuery 1')
      const elapsed = new Date() - d
      console.log(`rows.length ${data.rows.length} elapsed ${elapsed}`)
      response.end(JSON.stringify(data, null, 4))
      const close = toPromise(sql.close)
      console.log('close ...')
      await close()
      console.log('... close')
      console.log('<< test')
    } catch (err) {
      response.end(err.message)
    }
  } catch (err) {
    response.end(err.message)
  }
}

msnodesqlv8

Microsoft Driver for Node.js SQL Server compatible with all versions of Node.

Apache-2.0
Latest version published 7 months ago

Package Health Score

73 / 100
Full package analysis