Check for insert result in a for loop

Hi, I am not sure how to do this but I have a for loop that run insert for each iteration. I don't really need to get the data inserted but I am interested whether or not the entire loop ran smoothly or not. These are custom query so it's like db.execute(sql.raw()) and I get back a postgres.RowList How can I check for error here?
1 Reply
Angelelz
Angelelz10mo ago
Depending on your driver, there probably will be a field in the response along the lines of insertedRows that will be a number
Want results from more Discord servers?
Add your server