MCPcopy Create free account
hub / github.com/Kitware/VTK / GetTables

Method GetTables

IO/SQL/vtkSQLiteDatabase.cxx:349–379  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

347
348//------------------------------------------------------------------------------
349vtkStringArray* 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//------------------------------------------------------------------------------
382vtkStringArray* vtkSQLiteDatabase::GetRecord(const char* table)

Callers 2

TableNameIsNewMethod · 0.45
CheckIfTableExistsMethod · 0.45

Calls 9

GetQueryInstanceMethod · 0.95
DeleteMethod · 0.65
ResizeMethod · 0.45
SetQueryMethod · 0.45
ExecuteMethod · 0.45
NextRowMethod · 0.45
InsertNextValueMethod · 0.45
ToStringMethod · 0.45
DataValueMethod · 0.45

Tested by

no test coverage detected