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

Side by Side Diff: sql/connection.h

Issue 1069313004: [sql] Change DoesStuffExist() to work with ScopedErrorIgnorer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | sql/connection.cc » ('j') | sql/connection.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698