#include "PgClassContainer.h" #include "Pgsql_Connection.h" #include "Pgsql_Col.h" #include "PgDatabaseCatalog.h" #include "PgNamespaceContainer.h" std::string PgClassContainer::getLoadQuery() const { return "SELECT oid, relname, relnamespace, reltype, reloftype, " " relowner, relam, relfilenode, reltablespace, relpages, " " reltuples, reltoastrelid, relisshared, relpersistence, " " relkind, relhasoids, relispopulated, relfrozenxid, relminmxid, " " relacl, reloptions \n" "FROM pg_catalog.pg_class"; } 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 >> v.tuples_est >> v.toastrelid >> v.isshared >> v.persistence >> v.kind >> v.hasoids >> v.ispopulated >> v.frozenxid >> v.minmxid >> v.acl >> v.options; auto cat = m_catalogue.lock(); auto ns = cat->namespaces()->getByKey(v.relnamespace); v.relnamespace_name = ns.name; v.system_namespace = ns.isSystemCatalog(); return v; }