The table inheritance works mostly

When a table has partitions or inheritance children these are listed as subnodes. A subnode can appear multiple times under different parents as postgresql supports inheriting multiple tables.

The sizes are still missing and maybe some things I have note verified yet are not correct.
This commit is contained in:
eelke 2023-01-22 15:57:22 +01:00
parent ccd88d0578
commit 39dbab4d36
17 changed files with 452 additions and 127 deletions

View file

@ -4,17 +4,24 @@
#include "PgContainer.h"
#include "PgInherits.h"
#include "Pgsql_declare.h"
class IFindParents
{
public:
virtual std::vector<Oid> getParentsOf(Oid oid) const = 0;
};
class PgInheritsContainer : public PgContainer<PgInherits, PgInherits::Key> {
class PgInheritsContainer
: public PgContainer<PgInherits, PgInherits::Key>
, public IFindParents
{
public:
using PgContainer<PgInherits, PgInherits::Key>::PgContainer;
virtual std::string getLoadQuery() const override;
/// Returns the parents in the correct order
std::vector<Oid> getParentsOf(Oid oid) const;
std::vector<Oid> getParentsOf(Oid oid) const override;
protected:
PgInherits loadElem(const Pgsql::Row &row) override;
};