[whatwg] SQL API complex for simple cases

On Oct 31, 2007, at 4:56 PM, Ian Hickson wrote:

> The fear is that people would do:
>
>   db.executeSql('...', [], function(...) {
>     db.executeSql('...', []); // depends on the first call
>   });
>
> ...without a transaction.


How is that wrong? If the first executeSql fails the error callback  
(if any) will fire, not the normal callback.

   db.executeSql('CREATE TABLE ...', [], function(...) {
     db.executeSql('INSERT INTO ...', []);
   });

If the CREATE TABLE fails, the insert will never happen. If the INSERT  
fails, you don't really want the table to be rolled out. If you did,  
then you want a transaction. There are clearly times where you don't  
always want a transaction, but want to chain statements.

? Timothy Hatcher


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20071031/bc860409/attachment.htm>

Received on Wednesday, 31 October 2007 17:13:27 UTC