23 lines
589 B
C++
23 lines
589 B
C++
#include "PgNamespaceContainer.h"
|
|
#include "Pgsql_Col.h"
|
|
#include "Pgsql_Result.h"
|
|
#include "Pgsql_Value.h"
|
|
|
|
std::string PgNamespaceContainer::getLoadQuery() const
|
|
{
|
|
return "SELECT oid, nspname, nspowner, nspacl FROM pg_catalog.pg_namespace";
|
|
}
|
|
|
|
void PgNamespaceContainer::load(const Pgsql::Result &res)
|
|
{
|
|
const int n_rows = res.rows();
|
|
m_container.clear();
|
|
m_container.reserve(n_rows);
|
|
for (auto row : res) {
|
|
Pgsql::Col col(row);
|
|
PgNamespace v;
|
|
col >> v.oid >> v.name >> v.owner >> v.acl;
|
|
m_container.push_back(v);
|
|
}
|
|
std::sort(m_container.begin(), m_container.end());
|
|
}
|