Index: sql/connection.h |
diff --git a/sql/connection.h b/sql/connection.h |
index 9b81804bc1fafb68bac8bfb9a63dff4c6887305c..1e3414f40ca72912b0b8e0b64af1fa37d5e78a1f 100644 |
--- a/sql/connection.h |
+++ b/sql/connection.h |
@@ -181,6 +181,26 @@ class SQL_EXPORT Connection { |
// generally exist either. |
void Preload(); |
+ // Raze the database to the ground. This approximates creating a |
+ // fresh database from scratch, within the constraints of SQLite's |
+ // locking protocol (locks and open handles can make doing this with |
+ // filesystem operations problematic). Returns true if the database |
Greg Billock
2012/03/31 01:23:50
Does this mean it won't necessarily work? It seems
Scott Hess - ex-Googler
2012/04/04 01:28:25
My broad background with this change is:
A) corrup
Greg Billock
2012/04/04 19:49:21
Sounds good. I don't know if any of that's worth m
|
+ // was razed. |
+ // |
+ // false is returned if the database is locked by some other |
+ // process. RazeWithTimeout() may be used if appropriate. |
Greg Billock
2012/03/31 01:23:50
What's the use case for that kind of call?
Scott Hess - ex-Googler
2012/04/04 01:28:25
Most (all?) profile databases are exclusive-access
Greg Billock
2012/04/04 19:49:21
Do you envision using this most typically for WebS
Scott Hess - ex-Googler
2012/04/04 20:28:52
Mostly it's for profile dbs, but I believe websql
|
+ // |
+ // NOTE(shess): Raze() will DCHECK in the following situations: |
+ // - database is not open. |
+ // - the connection has a transaction open. |
+ // - a SQLite issue occurs which is structural in nature (like the |
+ // statements used are broken). |
+ // Since Raze() is expected to be called in unexpected situations, |
+ // these all return false, since it is unlikely that the caller |
+ // could fix them. |
+ bool Raze(); |
+ bool RazeWithTimout(base::TimeDelta timeout); |
+ |
// Transactions -------------------------------------------------------------- |
// Transaction management. We maintain a virtual transaction stack to emulate |