pgLab/pglablib/catalog/PgConstraintContainer.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

27 lines
909 B
C++

#ifndef PGCONSTRAINTCONTAINER_H
#define PGCONSTRAINTCONTAINER_H
#include "PgContainer.h"
#include "PgConstraint.h"
#include "Pgsql_declare.h"
#include <vector>
#include <optional>
class PgConstraintContainer : public PgContainer<PgConstraint> {
public:
using PgContainer<PgConstraint>::PgContainer;
virtual std::string getLoadQuery() const override;
//std::vector<PgConstraint> getIndexesForTable(Oid table_oid) const;
std::vector<PgConstraint> getFKeyForTableColumn(Oid relid, int16_t attnum) const;
std::vector<PgConstraint> getConstraintsForRelation(Oid relid) const;
std::optional<PgConstraint> getPrimaryForRelation(Oid relid) const;
std::vector<PgConstraint> getReferencedForRelation(Oid relid) const;
std::vector<PgConstraint> getSupportedByIndex(Oid indexrelid) const;
protected:
virtual PgConstraint loadElem(const Pgsql::Row &row) override;
};
#endif // PGCONSTRAINTCONTAINER_H