HTML 5 SQLite: Multiple Inserts in One Transaction
问题 Is it possible to do something like this: begin; insert into some_table (some_col, another_col) values ('a', 'b'); insert into some_table (some_col, another_col) values ('c', 'd'); ... commit; ...in HTML 5? With each transaction being async and having it's own callback, seems to me that it would be difficult to write a routine that inserts an unknown amount of rows, and then calls back when it has completed. 回答1: Here is sample code of how you do it. I tested in on recent versions of safari