pg_classes can be loaded now, used in TablesTableModel for overview of tables in database.
This commit is contained in:
parent
43e6042794
commit
6466062cc8
23 changed files with 524 additions and 173 deletions
|
|
@ -1,25 +1,60 @@
|
|||
#ifndef PGCLASS_H
|
||||
#define PGCLASS_H
|
||||
|
||||
#include "Pgsql_Value.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:
|
||||
PgClass();
|
||||
|
||||
Oid oid = InvalidOid;
|
||||
QString relname;
|
||||
QString name;
|
||||
Oid relnamespace = InvalidOid;
|
||||
Oid reltype = InvalidOid;
|
||||
Oid reloftype = InvalidOid;
|
||||
Oid relowner = InvalidOid;
|
||||
Oid relam = InvalidOid;
|
||||
Oid relfilename = InvalidOid;
|
||||
Oid reltablespace = InvalidOid;
|
||||
int relpages_est = 0;
|
||||
float reltuples_est = 0;
|
||||
int relallvisible = 0;
|
||||
Oid type = InvalidOid;
|
||||
Oid oftype = InvalidOid;
|
||||
Oid owner = InvalidOid;
|
||||
Oid am = InvalidOid;
|
||||
Oid filenode = InvalidOid;
|
||||
Oid tablespace = InvalidOid;
|
||||
int 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;
|
||||
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; }
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue