| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 SQL_CONNECTION_H_ | 5 #ifndef SQL_CONNECTION_H_ |
| 6 #define SQL_CONNECTION_H_ | 6 #define SQL_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 // Returns a non-cached statement for the given SQL. Use this for SQL that | 355 // Returns a non-cached statement for the given SQL. Use this for SQL that |
| 356 // is only executed once or only rarely (there is overhead associated with | 356 // is only executed once or only rarely (there is overhead associated with |
| 357 // keeping a statement cached). | 357 // keeping a statement cached). |
| 358 // | 358 // |
| 359 // See GetCachedStatement above for examples and error information. | 359 // See GetCachedStatement above for examples and error information. |
| 360 scoped_refptr<StatementRef> GetUniqueStatement(const char* sql); | 360 scoped_refptr<StatementRef> GetUniqueStatement(const char* sql); |
| 361 | 361 |
| 362 // Info querying ------------------------------------------------------------- | 362 // Info querying ------------------------------------------------------------- |
| 363 | 363 |
| 364 // Returns true if the given table exists. | 364 // Returns true if the given table (or index) exists. Instead of |
| 365 // test-then-create, callers should almost always prefer "CREATE TABLE IF NOT |
| 366 // EXISTS" or "CREATE INDEX IF NOT EXISTS". |
| 365 bool DoesTableExist(const char* table_name) const; | 367 bool DoesTableExist(const char* table_name) const; |
| 366 | |
| 367 // Returns true if the given index exists. | |
| 368 bool DoesIndexExist(const char* index_name) const; | 368 bool DoesIndexExist(const char* index_name) const; |
| 369 | 369 |
| 370 // Returns true if a column with the given name exists in the given table. | 370 // Returns true if a column with the given name exists in the given table. |
| 371 bool DoesColumnExist(const char* table_name, const char* column_name) const; | 371 bool DoesColumnExist(const char* table_name, const char* column_name) const; |
| 372 | 372 |
| 373 // Returns sqlite's internal ID for the last inserted row. Valid only | 373 // Returns sqlite's internal ID for the last inserted row. Valid only |
| 374 // immediately after an insert. | 374 // immediately after an insert. |
| 375 int64 GetLastInsertRowId() const; | 375 int64 GetLastInsertRowId() const; |
| 376 | 376 |
| 377 // Returns sqlite's count of the number of rows modified by the last | 377 // Returns sqlite's count of the number of rows modified by the last |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 | 592 |
| 593 // Tag for auxiliary histograms. | 593 // Tag for auxiliary histograms. |
| 594 std::string histogram_tag_; | 594 std::string histogram_tag_; |
| 595 | 595 |
| 596 DISALLOW_COPY_AND_ASSIGN(Connection); | 596 DISALLOW_COPY_AND_ASSIGN(Connection); |
| 597 }; | 597 }; |
| 598 | 598 |
| 599 } // namespace sql | 599 } // namespace sql |
| 600 | 600 |
| 601 #endif // SQL_CONNECTION_H_ | 601 #endif // SQL_CONNECTION_H_ |
| OLD | NEW |