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

Unified Diff: sql/connection.cc

Issue 10989063: Changed DB to store node positions as Ordinals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor changes and corrections Created 8 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
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index ea3dacbb6ba025dc248590a40031cc4a508541f4..ee713c8e51e125fe02f25c904f80e7ffad3af09f 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -14,6 +14,7 @@
#include "sql/statement.h"
#include "third_party/sqlite/sqlite3.h"
Scott Hess - ex-Googler 2012/10/02 03:58:47 Egregious whitespace change is egregious.
+
namespace {
// Spin for up to a second waiting for the lock to clear when setting
@@ -455,6 +456,19 @@ bool Connection::DoesColumnExist(const char* table_name,
return false;
}
+const std::string Connection::GetColumnType(const char* table_name,
+ int column_index) const {
+ std::string sql("PRAGMA TABLE_INFO (");
+ sql.append(table_name);
+ sql.append(")");
+
+ Statement statement(GetUntrackedStatement(sql.c_str()));
+ for(int i = 0; i <= column_index; i++)
+ statement.Step();
+
+ return statement.ColumnString(2);
+}
+
int64 Connection::GetLastInsertRowId() const {
if (!db_) {
DLOG(FATAL) << "Illegal use of connection without a db";

Powered by Google App Engine
This is Rietveld 408576698