[whatwg] SQL API error handling

Geoffrey Garen ggaren at apple.com
Tue Oct 16 16:04:51 PDT 2007


> It would be nice to have a way to indicate to the script "There was  
> a catastrophic event and we reset your database, assume you're  
> starting over from scratch."

In general, I'm not sure how useful it is to know that you're  
"starting over from scratch," since any database query needs to check  
its result. Presumably, an app's behavior in the "no data" case is the  
same regardless of *why* there's no data. 99% of the time the behavior  
will be to reload the data from a server.

More importantly, what constitutes a corrupt database, and how to  
recover from it, are serious implementation details. Some  
implementations may have error correction algorithms. Others may have  
backups they can restore. Others may have to wipe the database  
completely and start over. Still others may not be able to start  
anything. (For example, the storage medium might have gone bad, or  
been locked or disconnected.) So, imposing a "start over from scratch"  
requirement would hamper some implementations while requiring the  
impossible of others.

Geoff



More information about the whatwg mailing list