Referring to this thread How do I do a bulk insert in mySQL using node.js I have written the below code
const values = [
['e33b3c34923500e6', 'The Office', '330248b39a55d82a', '690db8528741c098'],
['e33b3c34923500e7', 'Prison Break', '330248b39a55d82a', '690db8528741c098']
]
let sql = `INSERT INTO Result (resultId, result, submissionId, questionId) VALUES ?`
connection.query(sql, [values], (err, res) => {console.log(err)
console.log(res)
})
Normal single inserts work with the given values but whenever trying to bulk insert like above I get the following error:
return await usedQueryRunner.query(query, parameters); // await is needed here because we are using finally TypeError: usedQueryRunner.query is not a function