2017-12-16 21:43:51 +01:00
|
|
|
|
#ifndef PGINDEX_H
|
|
|
|
|
|
#define PGINDEX_H
|
|
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
#include "PgNamespaceObject.h"
|
2017-12-16 21:43:51 +01:00
|
|
|
|
#include "Pgsql_declare.h"
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
class PgIndex : public PgNamespaceObject {
|
2017-12-16 21:43:51 +01:00
|
|
|
|
public:
|
|
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
// Oid indexrelid = InvalidOid; // oid of pg_class for this index
|
2018-08-25 18:11:12 +02:00
|
|
|
|
Oid relid = InvalidOid; // oid of table (pg_class) where this is an index on
|
2017-12-17 11:28:20 +01:00
|
|
|
|
int16_t natts = 0;
|
|
|
|
|
|
bool isunique = false;
|
|
|
|
|
|
bool isprimary = false;
|
|
|
|
|
|
bool isexclusion = false;
|
|
|
|
|
|
bool immediate = false;
|
|
|
|
|
|
bool isclustered = false;
|
|
|
|
|
|
bool isvalid = false;
|
|
|
|
|
|
bool checkxmin = false;
|
|
|
|
|
|
bool isready = false;
|
|
|
|
|
|
bool islive = false;
|
|
|
|
|
|
bool isreplident = false;
|
|
|
|
|
|
std::vector<int16_t> key;
|
|
|
|
|
|
std::vector<Oid> collation;
|
2017-12-16 21:43:51 +01:00
|
|
|
|
std::vector<Oid> indclass;
|
2017-12-17 11:28:20 +01:00
|
|
|
|
std::vector<int16_t> option;
|
|
|
|
|
|
QString exprs;
|
|
|
|
|
|
QString pred;
|
2017-12-17 19:34:28 +01:00
|
|
|
|
QString definition;
|
2017-12-16 21:43:51 +01:00
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
using PgNamespaceObject::PgNamespaceObject;
|
2018-08-25 18:11:12 +02:00
|
|
|
|
QString getAm() const;
|
2017-12-17 11:28:20 +01:00
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
// bool operator==(Oid _oid) const { return indexrelid == _oid; }
|
|
|
|
|
|
// //bool operator==(const QString &n) const { return name == n; }
|
|
|
|
|
|
// bool operator<(Oid _oid) const { return indexrelid < _oid; }
|
|
|
|
|
|
// bool operator<(const PgIndex &rhs) const { return indexrelid < rhs.indexrelid; }
|
2018-11-30 18:41:38 +01:00
|
|
|
|
|
|
|
|
|
|
QString createSql() const;
|
|
|
|
|
|
QString dropSql() const;
|
2017-12-16 21:43:51 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PGINDEX_H
|