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
|
|
@ -15,6 +15,7 @@ namespace Pgsql {
|
|||
class PgAttributeContainer;
|
||||
class PgAuthIdContainer;
|
||||
class PgClassContainer;
|
||||
class PgConstraintContainer;
|
||||
class PgDatabaseContainer;
|
||||
class PgIndexContainer;
|
||||
class PgNamespaceContainer;
|
||||
|
|
@ -32,13 +33,14 @@ public:
|
|||
void loadAll(Pgsql::Connection &conn);
|
||||
void loadInfo(Pgsql::Connection &conn);
|
||||
|
||||
void loadAttributes(Pgsql::Connection &conn);
|
||||
void loadAuthIds(Pgsql::Connection &conn);
|
||||
void loadClasses(Pgsql::Connection &conn);
|
||||
void loadDatabases(Pgsql::Connection &conn);
|
||||
void loadIndexes(Pgsql::Connection &conn);
|
||||
void loadNamespaces(Pgsql::Connection &conn);
|
||||
void loadTypes(Pgsql::Connection &conn);
|
||||
//void loadAttributes(Pgsql::Connection &conn);
|
||||
// void loadAuthIds(Pgsql::Connection &conn);
|
||||
// void loadClasses(Pgsql::Connection &conn);
|
||||
// void loadConstraints(Pgsql::Connection &conn);
|
||||
// void loadDatabases(Pgsql::Connection &conn);
|
||||
// void loadIndexes(Pgsql::Connection &conn);
|
||||
// void loadNamespaces(Pgsql::Connection &conn);
|
||||
// void loadTypes(Pgsql::Connection &conn);
|
||||
|
||||
const QString& serverVersionString() const;
|
||||
int serverVersion() const;
|
||||
|
|
@ -46,6 +48,7 @@ public:
|
|||
std::shared_ptr<const PgAttributeContainer> attributes() const;
|
||||
std::shared_ptr<const PgAuthIdContainer> authIds() const;
|
||||
std::shared_ptr<const PgClassContainer> classes() const;
|
||||
std::shared_ptr<const PgConstraintContainer> constraints() const;
|
||||
std::shared_ptr<const PgDatabaseContainer> databases() const;
|
||||
std::shared_ptr<const PgIndexContainer> indexes() const;
|
||||
std::shared_ptr<const PgNamespaceContainer> namespaces() const;
|
||||
|
|
@ -57,10 +60,21 @@ private:
|
|||
std::shared_ptr<PgAttributeContainer> m_attributes;
|
||||
std::shared_ptr<PgAuthIdContainer> m_authIds;
|
||||
std::shared_ptr<PgClassContainer> m_classes;
|
||||
std::shared_ptr<PgConstraintContainer> m_constraints;
|
||||
std::shared_ptr<PgDatabaseContainer> m_databases;
|
||||
std::shared_ptr<PgIndexContainer> m_indexes;
|
||||
std::shared_ptr<PgNamespaceContainer> m_namespaces;
|
||||
std::shared_ptr<PgTypeContainer> m_types;
|
||||
|
||||
template <typename T>
|
||||
void load2(std::shared_ptr<T> &ptr, Pgsql::Connection &conn)
|
||||
{
|
||||
if (!ptr)
|
||||
ptr = std::make_shared<T>(shared_from_this());
|
||||
|
||||
load(conn, *ptr);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
QString getRoleNameFromOid(const PgDatabaseCatalog &cat, Oid oid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue