pgLab/pglablib/catalog/PgIndex.h
eelke fd5ad9bbf0 On the list of indexes of a table show which were created as part of the creation of a constraint
The explicit column is true when the index was manually created
In SQL only a comment is given that the index was implicitly created
2021-04-11 07:56:37 +02:00

46 lines
1 KiB
C++

#ifndef PGINDEX_H
#define PGINDEX_H
#include "PgNamespaceObject.h"
#include "Pgsql_declare.h"
#include <QString>
#include <vector>
class PgIndex : public PgNamespaceObject {
public:
Oid relid = InvalidOid; // oid of table (pg_class) where this is an index on
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;
std::vector<Oid> indclass;
std::vector<int16_t> option;
QString exprs;
QString pred;
QString definition;
int64_t sizeBytes;
using PgNamespaceObject::PgNamespaceObject;
QString getAm() const;
QString createSql() const override;
QString dropSql() const override;
QString typeName() const override;
/// Returns true when this index has been created as part of the creation
/// of a constaint.
bool isSupportingIndex() const;
};
#endif // PGINDEX_H