PgAttribute loading + ColummnTableModel

Required enchancement to PgContainer to make multifield key work.
This commit is contained in:
eelke 2017-12-12 20:13:53 +01:00
parent f9caadb59e
commit e9d72d391d
32 changed files with 698 additions and 99 deletions

View file

@ -12,22 +12,14 @@ std::string PgClassContainer::getLoadQuery() const
"FROM pg_catalog.pg_class";
}
void PgClassContainer::load(const Pgsql::Result &res)
PgClass PgClassContainer::loadElem(const Pgsql::Row &row)
{
const int n_rows = res.rows();
m_container.clear();
m_container.reserve(n_rows);
for (auto row : res) {
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;
m_container.push_back(v);
}
std::sort(m_container.begin(), m_container.end());
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;
return v;
}