Rework of catalog objects. Several of them are now inheriting from common

base classes that implement common functionality.
This commit is contained in:
eelke 2018-11-25 19:45:06 +01:00
parent 840af1e0a9
commit 73c4cf4790
45 changed files with 340 additions and 265 deletions

View file

@ -1,4 +1,5 @@
#include "PgIndexContainer.h"
#include "PgClassContainer.h"
#include "PgDatabaseCatalog.h"
#include "Pgsql_Col.h"
#include <iterator>
@ -21,8 +22,13 @@ SELECT indexrelid, indrelid, indnatts, indisunique, indisprimary,
PgIndex PgIndexContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
PgIndex v(m_catalog);
col >> v.indexrelid >> v.relid >> v.natts >> v.isunique
Oid indexrelid = col.nextValue();
auto&& cls = m_catalog.classes()->getByKey(indexrelid);
auto&& name = cls->objectName();
auto&& nsoid = cls->nsOid();
PgIndex v(m_catalog, indexrelid, name, nsoid);
col >> v.relid >> v.natts >> v.isunique
>> v.isprimary >> v.isexclusion >> v.immediate >> v.isclustered
>> v.isvalid >> v.checkxmin >> v.isready >> v.islive;
col.getAsVector<int16_t>(std::back_inserter(v.key));