pgLab/opendatabase.cpp
Eelke Klein 6370050204 Introduced the MasterController as part of working on loading catalogue information.
Need a central piece to manage the catalogue data per database to prevent loading
this multiple times. MasterController is now also used to enable reopening the
connection manager from a query window after the connection manager has been closed.
2017-02-01 18:01:02 +01:00

30 lines
624 B
C++

#include "opendatabase.h"
#include "pgsqldatabasecatalogue.h"
Expected<OpenDatabase*> OpenDatabase::createOpenDatabase(const ConnectionConfig &cfg)
{
OpenDatabase *odb = new OpenDatabase(cfg, nullptr);
if (odb->Init()) {
return odb;
}
//return Expected<ConnectionConfig>::fromException(std::out_of_range("Invalid row"));
}
OpenDatabase::OpenDatabase(const ConnectionConfig& cfg, QObject *parent)
: QObject(parent)
, m_config(cfg)
, m_catalogue(new PgsqlDatabaseCatalogue)
{
}
OpenDatabase::~OpenDatabase()
{
delete m_catalogue;
}
bool OpenDatabase::Init()
{
// m_catalogue->load(m_config);
return true;
}