pgLab/pglablib/PgConstraintContainer.h
2018-01-08 20:45:52 +01:00

25 lines
772 B
C++

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