| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // results into |messages|. Returns the success of running the | 232 // results into |messages|. Returns the success of running the |
| 233 // statement - per the SQLite documentation, if no errors are found the | 233 // statement - per the SQLite documentation, if no errors are found the |
| 234 // call should succeed, and a single value "ok" should be in messages. | 234 // call should succeed, and a single value "ok" should be in messages. |
| 235 bool FullIntegrityCheck(std::vector<std::string>* messages); | 235 bool FullIntegrityCheck(std::vector<std::string>* messages); |
| 236 | 236 |
| 237 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, | 237 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, |
| 238 // interprets the results returning true if the the statement executes | 238 // interprets the results returning true if the the statement executes |
| 239 // without error and results in a single "ok" value. | 239 // without error and results in a single "ok" value. |
| 240 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; | 240 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; |
| 241 | 241 |
| 242 // Meant to be called from a client error callback so that it's able to |
| 243 // get diagnostic information about the database. |
| 244 std::string GetDiagnosticInfo(int extended_error, Statement* statement); |
| 245 |
| 242 // Initialization ------------------------------------------------------------ | 246 // Initialization ------------------------------------------------------------ |
| 243 | 247 |
| 244 // Initializes the SQL connection for the given file, returning true if the | 248 // Initializes the SQL connection for the given file, returning true if the |
| 245 // file could be opened. You can call this or OpenInMemory. | 249 // file could be opened. You can call this or OpenInMemory. |
| 246 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; | 250 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; |
| 247 | 251 |
| 248 // Initializes the SQL connection for a temporary in-memory database. There | 252 // Initializes the SQL connection for a temporary in-memory database. There |
| 249 // will be no associated file on disk, and the initial database will be | 253 // will be no associated file on disk, and the initial database will be |
| 250 // empty. You can call this or Open. | 254 // empty. You can call this or Open. |
| 251 bool OpenInMemory() WARN_UNUSED_RESULT; | 255 bool OpenInMemory() WARN_UNUSED_RESULT; |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 801 |
| 798 // Stores the dump provider object when db is open. | 802 // Stores the dump provider object when db is open. |
| 799 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; | 803 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; |
| 800 | 804 |
| 801 DISALLOW_COPY_AND_ASSIGN(Connection); | 805 DISALLOW_COPY_AND_ASSIGN(Connection); |
| 802 }; | 806 }; |
| 803 | 807 |
| 804 } // namespace sql | 808 } // namespace sql |
| 805 | 809 |
| 806 #endif // SQL_CONNECTION_H_ | 810 #endif // SQL_CONNECTION_H_ |
| OLD | NEW |