Rework of catalog objects. Several of them are now inheriting from common

base classes that implement common functionality.
This commit is contained in:
eelke 2018-11-25 19:45:06 +01:00
parent 840af1e0a9
commit 73c4cf4790
45 changed files with 340 additions and 265 deletions

View file

@ -2,6 +2,8 @@
#define PGCLASS_H
#include "Pgsql_Value.h"
#include "PgNamespaceObject.h"
#include "PgOwnedObject.h"
#include <QString>
#include <libpq-fe.h>
@ -27,17 +29,17 @@ enum class RelKind {
void operator<<(RelKind &s, const Pgsql::Value &v);
class PgClass {
class PgClass: public PgNamespaceObject, public PgOwnedObject {
public:
Oid oid = InvalidOid;
QString name;
Oid relnamespace = InvalidOid;
QString relnamespace_name; // Transient, cached value from relnamespace
bool system_namespace = false; // Transient, cached value from relnamespace
// Oid oid = InvalidOid;
// QString name;
// Oid relnamespace = InvalidOid;
// QString relnamespace_name; // Transient, cached value from relnamespace
// bool system_namespace = false; // Transient, cached value from relnamespace
Oid type = InvalidOid;
Oid oftype = InvalidOid;
Oid owner = InvalidOid;
//Oid owner = InvalidOid;
Oid am = InvalidOid;
Oid filenode = InvalidOid;
Oid tablespace = InvalidOid;
@ -54,10 +56,14 @@ public:
QString acl;
std::vector<QString> options;
bool operator==(Oid _oid) const { return oid == _oid; }
bool operator==(const QString &n) const { return name == n; }
bool operator<(Oid _oid) const { return oid < _oid; }
bool operator<(const PgClass &rhs) const { return oid < rhs.oid; }
using PgNamespaceObject::PgNamespaceObject;
// virtual QString objectName() const override;
// bool operator==(Oid _oid) const { return oid == _oid; }
// bool operator==(const QString &n) const { return objectName() == n; }
// bool operator<(Oid _oid) const { return oid < _oid; }
// bool operator<(const PgClass &rhs) const { return oid < rhs.oid; }
private:
};