Made a start with showing foreignkeys in column list.
Not finished, need to decide what to do with multiple and multi column fkeys.
This commit is contained in:
parent
a76686acfd
commit
190a6c04dc
14 changed files with 97 additions and 94 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include "PgAttributeContainer.h"
|
||||
#include "PgAuthIdContainer.h"
|
||||
#include "PgClassContainer.h"
|
||||
#include "PgConstraintContainer.h"
|
||||
#include "PgDatabaseContainer.h"
|
||||
#include "PgIndexContainer.h"
|
||||
#include "PgNamespaceContainer.h"
|
||||
|
|
@ -102,13 +103,14 @@ PgDatabaseCatalog::~PgDatabaseCatalog()
|
|||
void PgDatabaseCatalog::loadAll(Pgsql::Connection &conn)
|
||||
{
|
||||
loadInfo(conn);
|
||||
loadAttributes(conn);
|
||||
loadAuthIds(conn);
|
||||
loadClasses(conn);
|
||||
loadDatabases(conn);
|
||||
loadIndexes(conn);
|
||||
loadNamespaces(conn);
|
||||
loadTypes(conn);
|
||||
load2(m_attributes, conn);
|
||||
load2(m_authIds, conn);
|
||||
load2(m_classes, conn);
|
||||
load2(m_constraints, conn);
|
||||
load2(m_databases, conn);
|
||||
load2(m_indexes, conn);
|
||||
load2(m_namespaces, conn);
|
||||
load2(m_types, conn);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadInfo(Pgsql::Connection &conn)
|
||||
|
|
@ -138,63 +140,6 @@ void load(Pgsql::Connection &conn, IPgContainter &pg_cont)
|
|||
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadAttributes(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_attributes)
|
||||
m_attributes = std::make_shared<PgAttributeContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_attributes);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadAuthIds(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_authIds)
|
||||
m_authIds = std::make_shared<PgAuthIdContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_authIds);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadClasses(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_classes)
|
||||
m_classes = std::make_shared<PgClassContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_classes);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadDatabases(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_databases)
|
||||
m_databases = std::make_shared<PgDatabaseContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_databases);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadIndexes(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_indexes)
|
||||
m_indexes = std::make_shared<PgIndexContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_indexes);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadNamespaces(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_namespaces)
|
||||
m_namespaces = std::make_shared<PgNamespaceContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_namespaces);
|
||||
}
|
||||
|
||||
void PgDatabaseCatalog::loadTypes(Pgsql::Connection &conn)
|
||||
{
|
||||
if (!m_types)
|
||||
m_types = std::make_shared<PgTypeContainer>(shared_from_this());
|
||||
|
||||
load(conn, *m_types);
|
||||
}
|
||||
|
||||
|
||||
const QString& PgDatabaseCatalog::serverVersionString() const
|
||||
{
|
||||
return m_serverVersionString;
|
||||
|
|
@ -220,6 +165,11 @@ std::shared_ptr<const PgClassContainer> PgDatabaseCatalog::classes() const
|
|||
return m_classes;
|
||||
}
|
||||
|
||||
std::shared_ptr<const PgConstraintContainer> PgDatabaseCatalog::constraints() const
|
||||
{
|
||||
return m_constraints;
|
||||
}
|
||||
|
||||
std::shared_ptr<const PgDatabaseContainer> PgDatabaseCatalog::databases() const
|
||||
{
|
||||
return m_databases;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue