Transactions in node-sqlite3
问题 In node-sqlite3 , if the db is currently in serialized mode, will the next statement wait before the callback of the previous statement finishes, or will the callback run at the same time as the next statement? What's the best way to write a transaction using node-sqlite3 ? I've thought about these two approaches, but I'm not sure which one is correct, or even if they're both wrong. // NEXT DB STATEMENT WAITS FOR CALLBACK TO COMPLETE? db.serialize(() => { db.run('BEGIN'); // statement 1 db