为什么这段代码在Visual Studio代码2018中不起作用

时间:2018-03-21 20:11:38

标签: sql-server node.js

function getCurrentId ()  {
    var data;
    var query = "INSERT INTO photos (path) VALUES (''); SELECT SCOPE_IDENTITY() AS id ";
    var request = new mssql.Request(connection);
    return new Promise(function(resolve, reject) {
        request.query(query, function(err, data) {
             resolve(data.recordset)
        });
    })
}

var main = async () =>{
    var quote =  await  getCurrentId enter code here();
    return quote; enter code here
};

我在此代码中使用异步等待但是。但此代码不正确。

var main = (async () =>{
              ^
  

SyntaxError:意外的令牌(

0 个答案:

没有答案