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

@ -1,15 +1,15 @@
#ifndef PGDATABASE_H
#define PGDATABASE_H
#include "PgServerObject.h"
#include <QString>
#include <libpq-fe.h>
class PgDatabase {
class PgDatabase: public PgServerObject {
public:
PgDatabase();
Oid oid = InvalidOid;
QString name;
// Oid oid = InvalidOid;
// QString name;
Oid dba; // owner?
int encoding;
QString collate;
@ -20,12 +20,14 @@ public:
Oid tablespace;
QString acl;//"ARRAY";"YES"
bool isValid() const { return oid != InvalidOid; }
using PgServerObject::PgServerObject;
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 PgDatabase &rhs) const { return oid < rhs.oid; }
bool isValid() const { return oid() != InvalidOid; }
// 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 PgDatabase &rhs) const { return oid() < rhs.oid(); }
};
#endif // PGDATABASE_H