OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_SQLITEUTILS_H_ | 5 #ifndef CHROME_COMMON_SQLITEUTILS_H_ |
6 #define CHROME_COMMON_SQLITEUTILS_H_ | 6 #define CHROME_COMMON_SQLITEUTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 int prepare(sqlite3* db, const char* sql) { | 209 int prepare(sqlite3* db, const char* sql) { |
210 return prepare(db, sql, -1); | 210 return prepare(db, sql, -1); |
211 } | 211 } |
212 | 212 |
213 int prepare(sqlite3* db, const char* sql, int sql_len); | 213 int prepare(sqlite3* db, const char* sql, int sql_len); |
214 | 214 |
215 int step(); | 215 int step(); |
216 int reset(); | 216 int reset(); |
217 sqlite_int64 last_insert_rowid(); | 217 sqlite_int64 last_insert_rowid(); |
| 218 int changes(); |
218 sqlite3* db_handle(); | 219 sqlite3* db_handle(); |
219 | 220 |
220 // | 221 // |
221 // Parameter binding helpers (NOTE: index is 0-based) | 222 // Parameter binding helpers (NOTE: index is 0-based) |
222 // | 223 // |
223 | 224 |
224 int bind_parameter_count(); | 225 int bind_parameter_count(); |
225 | 226 |
226 typedef void (*Function)(void*); | 227 typedef void (*Function)(void*); |
227 | 228 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 const char* column_name, | 343 const char* column_name, |
343 const char* column_type) { | 344 const char* column_type) { |
344 return DoesSqliteColumnExist(db, NULL, table_name, column_name, column_type); | 345 return DoesSqliteColumnExist(db, NULL, table_name, column_name, column_type); |
345 } | 346 } |
346 | 347 |
347 // Test whether a table has one or more rows. Returns true if the table | 348 // Test whether a table has one or more rows. Returns true if the table |
348 // has one or more rows and false if the table is empty or doesn't exist. | 349 // has one or more rows and false if the table is empty or doesn't exist. |
349 bool DoesSqliteTableHaveRow(sqlite3* db, const char* table_name); | 350 bool DoesSqliteTableHaveRow(sqlite3* db, const char* table_name); |
350 | 351 |
351 #endif // CHROME_COMMON_SQLITEUTILS_H_ | 352 #endif // CHROME_COMMON_SQLITEUTILS_H_ |
OLD | NEW |