continue icon indicating copy to clipboard operation
continue copied to clipboard

Move the bulk insert resolve into the COMMIT callback

Open spew opened this issue 1 year ago • 0 comments

Description

db.db.serialize(...) guarantees that each statement runs in order. However, the function itself will terminate execution long before all the statements are executed. Therefore, we should only resolve the promise when the last COMMIT transaction has run. In the other cases, there will have been an error and we'll have call reject(err).

This also removed the need for the extra insert that was recently added so it was removed (in fact the extra insert was causing conflict errors).

Checklist

  • [x] The base branch of this PR is dev, rather than main
  • [x] The relevant docs, if any, have been updated or created

spew avatar Aug 09 '24 23:08 spew