Switched ConnectionConfig to QString from std::string to fit better into Qt framework
This commit is contained in:
parent
bcfd82c27d
commit
082293e58a
20 changed files with 1077 additions and 211 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "Pgsql_Connection.h"
|
||||
#include "Pgsql_PgException.h"
|
||||
#include "model/TypeSelectionItemModel.h"
|
||||
#include <QDebug>
|
||||
|
||||
OpenDatabase::OpenDatabaseSPtr OpenDatabase::createOpenDatabase(const ConnectionConfig &cfg)
|
||||
{
|
||||
|
|
@ -27,10 +28,13 @@ OpenDatabase::~OpenDatabase() = default;
|
|||
void OpenDatabase::Init()
|
||||
{
|
||||
Pgsql::Connection conn;
|
||||
auto kw = m_config.getKeywords();
|
||||
auto vals = m_config.getValues();
|
||||
conn.connect(kw, vals, 0);
|
||||
m_catalog->loadAll(conn, nullptr);
|
||||
std::string connstr = m_config.connectionString().toStdString();
|
||||
if (conn.connect(connstr.c_str())) {
|
||||
m_catalog->loadAll(conn, nullptr);
|
||||
}
|
||||
else {
|
||||
qDebug() << "Connect failed connstr: " << connstr.c_str();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<PgDatabaseCatalog> OpenDatabase::catalog()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue