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

@ -18,17 +18,22 @@ std::string PgClassContainer::getLoadQuery() const
PgClass PgClassContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
PgClass v;
col >> v.oid >> v.name >> v.relnamespace >> v.type >> v.oftype
>> v.owner >> v.am >> v.filenode >> v.tablespace >> v.pages_est
Oid class_oid = col.nextValue();
QString name = col.nextValue();
Oid schema_oid = col.nextValue();
PgClass v(m_catalog, class_oid, name, schema_oid);
Oid owner ;
col >> v.type >> v.oftype
>> owner >> v.am >> v.filenode >> v.tablespace >> v.pages_est
>> v.tuples_est >> v.toastrelid >> v.isshared >> v.persistence
>> v.kind >> v.hasoids >> v.ispopulated >> v.frozenxid >> v.minmxid
>> v.acl >> v.options;
auto&& ns = m_catalog.namespaces()->getByKey(v.relnamespace);
if (ns) {
v.relnamespace_name = ns->name;
v.system_namespace = ns->isSystemCatalog();
}
v.setOwnerOid(m_catalog, owner);
// auto&& ns = m_catalog.namespaces()->getByKey(v.relnamespace);
// if (ns) {
// v.relnamespace_name = ns->objectName();
// v.system_namespace = ns->isSystemCatalog();
// }
return v;
}