| 655 | } |
| 656 | |
| 657 | bool 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 |
no test coverage detected