I am working on API development using AWS API getaway and lambda. I am using Serverless MySQL https://www.npmjs.com/package/serverless-mysql package for mysql connection and operation. but I am unable to execute multiple queries. Please check below code.
It's showing error "Parsing error: Unexpected token connection".
var sql_1 = 'Query 1';
let rows = await connection.query(sql_1);
rows.forEach(function (row) {
var sql_2 = 'Query 2';
let rows = await connection.query(sql_2); // I am refering id in sql2 from result of sql_1
});