31 lines
624 B
C++
31 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;
|
|||
|
|
}
|