So I am trying the following: This results in “SQLITE_MISUSE: Database handle is closed” Apparently I cannot run the UPDATE query within the db.all callback. But why is that so? Answer You should put the second query as an argument to db.serialize(). Then it will wait for it to complete before returning and allowing db.close() to run.