------------------------------------------------------------------------------
| 347 | |
| 348 | //------------------------------------------------------------------------------ |
| 349 | vtkStringArray* vtkSQLiteDatabase::GetTables() |
| 350 | { |
| 351 | this->Tables->Resize(0); |
| 352 | if (this->Internal->SQLiteInstance == nullptr) |
| 353 | { |
| 354 | vtkErrorMacro(<< "GetTables(): Database is not open!"); |
| 355 | return this->Tables; |
| 356 | } |
| 357 | |
| 358 | vtkSQLQuery* query = this->GetQueryInstance(); |
| 359 | query->SetQuery("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name"); |
| 360 | bool status = query->Execute(); |
| 361 | |
| 362 | if (!status) |
| 363 | { |
| 364 | vtkErrorMacro(<< "GetTables(): Database returned error: " |
| 365 | << sqlite3_errmsg(this->Internal->SQLiteInstance)); |
| 366 | query->Delete(); |
| 367 | return this->Tables; |
| 368 | } |
| 369 | else |
| 370 | { |
| 371 | vtkDebugMacro(<< "GetTables(): SQL query succeeded."); |
| 372 | while (query->NextRow()) |
| 373 | { |
| 374 | this->Tables->InsertNextValue(query->DataValue(0).ToString()); |
| 375 | } |
| 376 | query->Delete(); |
| 377 | return this->Tables; |
| 378 | } |
| 379 | } |
| 380 | |
| 381 | //------------------------------------------------------------------------------ |
| 382 | vtkStringArray* vtkSQLiteDatabase::GetRecord(const char* table) |
no test coverage detected