PgType now inherits from PgNamespaceObject and PgOwnedObject

This commit is contained in:
eelke 2018-12-16 09:24:27 +01:00
parent 742fd0a4d3
commit 44358d198a
10 changed files with 37 additions and 54 deletions

View file

@ -1,6 +1,8 @@
#ifndef PGTYPE_H
#define PGTYPE_H
#include "PgNamespaceObject.h"
#include "PgOwnedObject.h"
#include <QString>
#include <libpq-fe.h>
#include "Pgsql_Value.h"
@ -26,15 +28,13 @@ enum class TypCategory {
void operator<<(TypCategory &s, const Pgsql::Value &v);
class PgType {
class PgType: public PgNamespaceObject, public PgOwnedObject {
public:
PgType();
Oid oid = InvalidOid;
QString name; // formatted name as per database, arrays
// Oid oid = InvalidOid;
// QString name; // formatted name as per database, arrays
QString typname; //"name";"NO"
Oid typnamespace = InvalidOid;//"oid";"NO"
Oid owner = InvalidOid;//"oid";"NO"
// Oid typnamespace = InvalidOid;//"oid";"NO"
// Oid owner = InvalidOid;//"oid";"NO"
short len = -1;//"smallint";"NO"
bool byval = false;//"boolean";"NO"
QString type;//""char"";"NO"
@ -63,10 +63,12 @@ public:
QString typdefault;//"text";"YES"
QString acl;//"ARRAY";"YES"
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 PgType &rhs) const { return oid < rhs.oid; }
using PgNamespaceObject::PgNamespaceObject;
// 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 PgType &rhs) const { return oid < rhs.oid; }
};
#endif // PGTYPE_H