How can I get all inserted ids in mysql using node module in node.js?

Viewed 153

I have table

users

id name
1 One
2 two

I want to insert multiple data in this table with

const query = `INSERT INTO users (`name`) VALUES("three"), ("four")`;

now I used this with any npm module like:

const result = await SQL.query(query);

then it returns only 4 but I want [3,4] (auto incremented Id) (and wants all new inserted data's id like 3 and four currently it returns only 4) how can I archive this

0 Answers
Related