Reorganize files in pglablib
The enitities and containers of the catalog now go into catalog subfolder Models go into model
This commit is contained in:
parent
56cbeea183
commit
f0c1035378
121 changed files with 226 additions and 183 deletions
76
pglablib/catalog/PgClass.h
Normal file
76
pglablib/catalog/PgClass.h
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
#ifndef PGCLASS_H
|
||||
#define PGCLASS_H
|
||||
|
||||
#include "Pgsql_Value.h"
|
||||
#include "PgNamespaceObject.h"
|
||||
#include "PgOwnedObject.h"
|
||||
#include <QString>
|
||||
#include <libpq-fe.h>
|
||||
|
||||
enum class RelPersistence {
|
||||
Permanent, // p
|
||||
Unlogged, // u
|
||||
Temporary // t
|
||||
};
|
||||
|
||||
void operator<<(RelPersistence &s, const Pgsql::Value &v);
|
||||
|
||||
enum class RelKind {
|
||||
Table, // r
|
||||
Index, // i
|
||||
Sequence, // S
|
||||
View, // v
|
||||
MaterializedView, // m
|
||||
Composite, // c
|
||||
Toast, // t
|
||||
ForeignTable // f
|
||||
};
|
||||
|
||||
void operator<<(RelKind &s, const Pgsql::Value &v);
|
||||
|
||||
|
||||
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 type = InvalidOid;
|
||||
Oid oftype = InvalidOid;
|
||||
//Oid owner = InvalidOid;
|
||||
Oid am = InvalidOid;
|
||||
Oid filenode = InvalidOid;
|
||||
Oid tablespace = InvalidOid;
|
||||
int32_t pages_est = 0;
|
||||
float tuples_est = 0.0f;
|
||||
Oid toastrelid = InvalidOid;
|
||||
bool isshared = false;
|
||||
RelPersistence persistence;
|
||||
RelKind kind;
|
||||
bool hasoids = false;
|
||||
bool ispopulated;
|
||||
int frozenxid;
|
||||
int minmxid;
|
||||
QString acl;
|
||||
std::vector<QString> options;
|
||||
|
||||
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; }
|
||||
|
||||
QString createSql() const;
|
||||
|
||||
private:
|
||||
mutable QString createSqlCache;
|
||||
|
||||
QString createTableSql() const;
|
||||
};
|
||||
|
||||
#endif // PGCLASS_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue