2017-12-20 22:01:42 +01:00
|
|
|
|
#ifndef PGCONSTRAINTCONTAINER_H
|
|
|
|
|
|
#define PGCONSTRAINTCONTAINER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "PgContainer.h"
|
|
|
|
|
|
#include "PgConstraint.h"
|
|
|
|
|
|
#include "Pgsql_declare.h"
|
|
|
|
|
|
#include <vector>
|
2018-11-08 21:50:49 +01:00
|
|
|
|
#include <optional>
|
2017-12-20 22:01:42 +01:00
|
|
|
|
|
|
|
|
|
|
class PgConstraintContainer : public PgContainer<PgConstraint> {
|
|
|
|
|
|
public:
|
|
|
|
|
|
using PgContainer<PgConstraint>::PgContainer;
|
|
|
|
|
|
|
|
|
|
|
|
virtual std::string getLoadQuery() const override;
|
|
|
|
|
|
//std::vector<PgConstraint> getIndexesForTable(Oid table_oid) const;
|
2018-11-10 13:36:36 +01:00
|
|
|
|
std::vector<PgConstraint> getFKeyForTableColumn(Oid relid, int16_t attnum) const;
|
2017-12-30 12:57:55 +01:00
|
|
|
|
|
|
|
|
|
|
std::vector<PgConstraint> getConstraintsForRelation(Oid relid) const;
|
2018-11-08 21:50:49 +01:00
|
|
|
|
std::optional<PgConstraint> getPrimaryForRelation(Oid relid) const;
|
2017-12-20 22:01:42 +01:00
|
|
|
|
protected:
|
|
|
|
|
|
virtual PgConstraint loadElem(const Pgsql::Row &row) override;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PGCONSTRAINTCONTAINER_H
|