拿官方的简单例子
const sql = require('mssql');
async () => {
try {
const pool = await sql.connect('mssql://username:password@localhost/database')
const result = await sql.query`select * from mytable where id = ${value}`
console.dir(result)
} catch (err) {
// ... error checks
}
}
出错:
你的 node 版本太低,不支持 async function。你需要 node 8。