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_STATEMENT_H_ | 5 #ifndef SQL_STATEMENT_H_ |
6 #define SQL_STATEMENT_H_ | 6 #define SQL_STATEMENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 // while (s.Step()) { | 84 // while (s.Step()) { |
85 // ... | 85 // ... |
86 // } | 86 // } |
87 // return s.Succeeded(); | 87 // return s.Succeeded(); |
88 bool Step(); | 88 bool Step(); |
89 | 89 |
90 // Resets the statement to its initial condition. This includes clearing all | 90 // Resets the statement to its initial condition. This includes clearing all |
91 // the bound variables and any current result row. | 91 // the bound variables and any current result row. |
92 void Reset(); | 92 void Reset(); |
93 | 93 |
94 // Resets the statement to its initial condition without clearing the bound | |
95 // variables. | |
96 void ResetWithoutClearingBoundVariables(); | |
brettw
2012/04/24 23:12:30
This name seems awkward and out of place. It looks
michaelbai
2012/04/25 17:10:52
Done.
Scott Hess - ex-Googler
2012/07/03 00:34:34
In my imagination, ResetWithoutClearingBoundVariab
| |
97 | |
94 // Returns true if the last executed thing in this statement succeeded. If | 98 // Returns true if the last executed thing in this statement succeeded. If |
95 // there was no last executed thing or the statement is invalid, this will | 99 // there was no last executed thing or the statement is invalid, this will |
96 // return false. | 100 // return false. |
97 bool Succeeded() const; | 101 bool Succeeded() const; |
98 | 102 |
99 // Binding ------------------------------------------------------------------- | 103 // Binding ------------------------------------------------------------------- |
100 | 104 |
101 // These all take a 0-based argument index and return true on success. You | 105 // These all take a 0-based argument index and return true on success. You |
102 // may not always care about the return value (they'll DCHECK if they fail). | 106 // may not always care about the return value (they'll DCHECK if they fail). |
103 // The main thing you may want to check is when binding large blobs or | 107 // The main thing you may want to check is when binding large blobs or |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
181 | 185 |
182 // See Succeeded() for what this holds. | 186 // See Succeeded() for what this holds. |
183 bool succeeded_; | 187 bool succeeded_; |
184 | 188 |
185 DISALLOW_COPY_AND_ASSIGN(Statement); | 189 DISALLOW_COPY_AND_ASSIGN(Statement); |
186 }; | 190 }; |
187 | 191 |
188 } // namespace sql | 192 } // namespace sql |
189 | 193 |
190 #endif // SQL_STATEMENT_H_ | 194 #endif // SQL_STATEMENT_H_ |
OLD | NEW |