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

Method OpenInternal

IO/PostgreSQL/vtkPostgreSQLDatabase.cxx:657–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657bool vtkPostgreSQLDatabase::OpenInternal(const char* connectionOptions)
658{
659 assert(this->Connection == nullptr);
660 this->Connection = new vtkPostgreSQLDatabasePrivate;
661 this->Connection->Connection = PQconnectdb(connectionOptions);
662 if (PQstatus(this->Connection->Connection) == CONNECTION_OK)
663 {
664 this->SetLastErrorText(nullptr);
665 this->UpdateDataTypeMap();
666 return true;
667 }
668 else
669 {
670 this->SetLastErrorText(PQerrorMessage(this->Connection->Connection));
671 vtkErrorMacro(<< "Unable to open database connection. " << this->GetLastErrorText());
672 delete this->Connection;
673 this->Connection = nullptr;
674 return false;
675 }
676}
677
678//------------------------------------------------------------------------------
679

Callers 1

OpenMethod · 0.95

Calls 3

UpdateDataTypeMapMethod · 0.95
GetLastErrorTextMethod · 0.95
assertFunction · 0.50

Tested by

no test coverage detected