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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // situations may. Therefore, the code is handling disjoint situations in | 171 // situations may. Therefore, the code is handling disjoint situations in |
172 // release and test. In test, we're ensuring correct SQL. In release, we're | 172 // release and test. In test, we're ensuring correct SQL. In release, we're |
173 // ensuring that contracts are honored in error edge cases. | 173 // ensuring that contracts are honored in error edge cases. |
174 bool CheckValid() const; | 174 bool CheckValid() const; |
175 | 175 |
176 // The actual sqlite statement. This may be unique to us, or it may be cached | 176 // The actual sqlite statement. This may be unique to us, or it may be cached |
177 // by the connection, which is why it's refcounted. This pointer is | 177 // by the connection, which is why it's refcounted. This pointer is |
178 // guaranteed non-NULL. | 178 // guaranteed non-NULL. |
179 scoped_refptr<Connection::StatementRef> ref_; | 179 scoped_refptr<Connection::StatementRef> ref_; |
180 | 180 |
| 181 // Set after Step() or Run() are called, reset by Reset(). Used to |
| 182 // prevent accidental calls to API functions which would not work |
| 183 // correctly after stepping has started. |
| 184 bool stepped_; |
| 185 |
181 // See Succeeded() for what this holds. | 186 // See Succeeded() for what this holds. |
182 bool succeeded_; | 187 bool succeeded_; |
183 | 188 |
184 DISALLOW_COPY_AND_ASSIGN(Statement); | 189 DISALLOW_COPY_AND_ASSIGN(Statement); |
185 }; | 190 }; |
186 | 191 |
187 } // namespace sql | 192 } // namespace sql |
188 | 193 |
189 #endif // SQL_STATEMENT_H_ | 194 #endif // SQL_STATEMENT_H_ |
OLD | NEW |