poc Add support for reloading the catalog
Reload works and the column page reacts correctly. Others to be checked and fixed.
This commit is contained in:
parent
83122e89df
commit
60d8f36328
8 changed files with 89 additions and 40 deletions
|
|
@ -27,14 +27,7 @@ OpenDatabase::~OpenDatabase() = default;
|
|||
|
||||
void OpenDatabase::Init()
|
||||
{
|
||||
Pgsql::Connection conn;
|
||||
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();
|
||||
}
|
||||
refresh();
|
||||
}
|
||||
|
||||
std::shared_ptr<PgDatabaseCatalog> OpenDatabase::catalog()
|
||||
|
|
@ -51,3 +44,15 @@ TypeSelectionItemModel* OpenDatabase::typeSelectionModel()
|
|||
}
|
||||
return m_typeSelectionModel;
|
||||
}
|
||||
|
||||
void OpenDatabase::refresh()
|
||||
{
|
||||
Pgsql::Connection conn;
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue