------------------------------------------------------------------------------
| 290 | |
| 291 | //------------------------------------------------------------------------------ |
| 292 | bool vtkSQLiteQuery::NextRow() |
| 293 | { |
| 294 | if (!this->IsActive()) |
| 295 | { |
| 296 | vtkErrorMacro(<< "NextRow(): Query is not active!"); |
| 297 | return false; |
| 298 | } |
| 299 | |
| 300 | if (this->InitialFetch) |
| 301 | { |
| 302 | vtkDebugMacro(<< "NextRow(): Initial fetch being handled."); |
| 303 | this->InitialFetch = false; |
| 304 | return this->InitialFetchResult != SQLITE_DONE; |
| 305 | } |
| 306 | else |
| 307 | { |
| 308 | int result = sqlite3_step(this->Private->Statement); |
| 309 | if (result == SQLITE_DONE) |
| 310 | { |
| 311 | return false; |
| 312 | } |
| 313 | else if (result == SQLITE_ROW) |
| 314 | { |
| 315 | return true; |
| 316 | } |
| 317 | else |
| 318 | { |
| 319 | vtkSQLiteDatabase* dbContainer = vtkSQLiteDatabase::SafeDownCast(this->Database); |
| 320 | assert(dbContainer != nullptr); |
| 321 | sqlite3* db = dbContainer->Internal->SQLiteInstance; |
| 322 | this->SetLastErrorText(sqlite3_errmsg(db)); |
| 323 | vtkErrorMacro(<< "NextRow(): Database returned error code " << result |
| 324 | << " with the following message: " << this->GetLastErrorText()); |
| 325 | this->Active = false; |
| 326 | return false; |
| 327 | } |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | //------------------------------------------------------------------------------ |
| 332 | vtkVariant vtkSQLiteQuery::DataValue(vtkIdType column) |
nothing calls this directly
no test coverage detected