Restructured locations of source.
This commit is contained in:
parent
78a4c6d730
commit
7c4e8e95e8
151 changed files with 1 additions and 0 deletions
36
src/pglab/PgDatabaseContainer.cpp
Normal file
36
src/pglab/PgDatabaseContainer.cpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#include "PgDatabaseContainer.h"
|
||||
#include "Pgsql_Connection.h"
|
||||
|
||||
PgDatabaseContainer::PgDatabaseContainer(PgDatabaseCatalogue *cat)
|
||||
: PgContainer<PgDatabase>(cat)
|
||||
{}
|
||||
|
||||
std::string PgDatabaseContainer::getLoadQuery() const
|
||||
{
|
||||
return "SELECT oid,datname,datdba,encoding,datcollate,datctype,datistemplate,datallowconn,"
|
||||
"datconnlimit,dattablespace,datacl FROM pg_database";
|
||||
}
|
||||
|
||||
void PgDatabaseContainer::load(const Pgsql::Result &res)
|
||||
{
|
||||
const int n_rows = res.rows();
|
||||
m_container.clear();
|
||||
m_container.reserve(n_rows);
|
||||
for (auto row : res) {
|
||||
PgDatabase v;
|
||||
v.oid << row.get(0); // InvalidOid;
|
||||
v.name << row.get(1);
|
||||
v.dba << row.get(2); // owner?
|
||||
v.encoding << row.get(3);
|
||||
v.collate << row.get(4);
|
||||
v.ctype << row.get(5);
|
||||
v.isTemplate << row.get(6);
|
||||
v.allowConn << row.get(7);
|
||||
v.connLimit << row.get(8);
|
||||
v.tablespace << row.get(9);
|
||||
v.acl << row.get(10);
|
||||
m_container.push_back(v);
|
||||
}
|
||||
std::sort(m_container.begin(), m_container.end());
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue