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:
parent
ccd88d0578
commit
39dbab4d36
17 changed files with 452 additions and 127 deletions
32
pglablib/ui/catalog/tables/TableTreeBuilder.h
Normal file
32
pglablib/ui/catalog/tables/TableTreeBuilder.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include "Pgsql_oids.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
class PgClass;
|
||||
class TableNode;
|
||||
class IFindParents;
|
||||
|
||||
class TableTreeBuilder
|
||||
{
|
||||
public:
|
||||
TableTreeBuilder(const std::map<Oid, PgClass> &source, const IFindParents &inheritance);
|
||||
|
||||
std::shared_ptr<TableNode> Build();
|
||||
|
||||
private:
|
||||
const std::map<Oid, PgClass> &source;
|
||||
const IFindParents &inheritance;
|
||||
std::map<Oid, std::shared_ptr<TableNode>> processedNodes;
|
||||
std::shared_ptr<TableNode> rootNode;
|
||||
|
||||
void resetState();
|
||||
bool hasParent(const PgClass &cls) const;
|
||||
std::shared_ptr<TableNode> addNode(const PgClass &cls);
|
||||
void addToplevelNode(std::shared_ptr<TableNode> node);
|
||||
void addToParents(std::shared_ptr<TableNode> node, const std::vector<Oid> &parents);
|
||||
std::shared_ptr<TableNode> getParent(Oid oid);
|
||||
void AssignNodeIndexesAndParents(std::shared_ptr<TableNode> parent);
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue