I've looked into this answer
What I'm looking for is to be able to insert rows from a previous select query in nodejs and use the same RowDataPacket
and pass it to another insert query.
For instance, result from previous select call
[ RowDataPacket { user_id: 1024, session_id: 3, notification_id: 1 },
RowDataPacket { user_id: 1028, session_id: 3, notification_id: 2 } ] ]
following insert
var sql = 'INSERT INTO user_session_notification(user_id, session_id, notification_id) VALUES ?'
var values = []; // ???