Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(961)

Unified Diff: app/sql/statement.h

Issue 223003: Add basic sqlite error handling to the new sqlite handlers... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/sql/connection.cc ('k') | app/sql/statement.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/sql/statement.h
===================================================================
--- app/sql/statement.h (revision 27122)
+++ app/sql/statement.h (working copy)
@@ -22,6 +22,10 @@
// s.BindInt(0, a);
// if (s.Step())
// return s.ColumnString(0);
+//
+// Step() and Run() just return true to signal success. If you want to handle
+// specific errors such as database corruption, install an error handler in
+// in the connection object using set_error_delegate().
class Statement {
public:
// Creates an uninitialized statement. The statement will be invalid until
@@ -110,6 +114,11 @@
void ColumnBlobAsVector(int col, std::vector<char>* val) const;
void ColumnBlobAsVector(int col, std::vector<unsigned char>* val) const;
+ // Diagnostics --------------------------------------------------------------
+
+ // Returns the original text of sql statement. Do not keep a pointer to it.
+ const char* GetSQLStatement();
+
private:
// This is intended to check for serious errors and report them to the
// connection object. It takes a sqlite error code, and returns the same
« no previous file with comments | « app/sql/connection.cc ('k') | app/sql/statement.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698