How can I get the whole just inserted data without another query, is that possible?
I know the ID is there in the response payload: data.insertId
My issue is that when I insert the values there is an auto timestamp and I need it, but I don't want to query the DB again because of performance
db.query(`INSERT INTO PRODUCTS(prd_name, prd_price) \
VALUES('${this.prd_name}',${this.prd_price})`, (err, data) => {
res.status(200).json({
message: 'Product added.',
newProductData: data.WHOLE_ROW?????,
});
});