pgLab/pglablib/catalog/PgAuthIdContainer.cpp
eelke f0c1035378 Reorganize files in pglablib
The enitities and containers of the catalog now go into catalog subfolder
Models go into model
2018-12-16 11:31:33 +01:00

27 lines
696 B
C++

#include "PgAuthIdContainer.h"
#include "Pgsql_Col.h"
std::string PgAuthIdContainer::getLoadQuery() const
{
std::string result =
"SELECT oid, rolname, rolsuper, rolinherit, rolcreaterole, rolcreatedb, "
" rolcanlogin, rolreplication, rolconnlimit, rolvaliduntil";
if (minimumVersion(90500))
result += ", rolbypassrls";
result += "\n"
"FROM pg_authid";
return result;
}
PgAuthId PgAuthIdContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
PgAuthId v;
col >> v.oid >> v.name >> v.super >> v.inherit >> v.createRole >> v.createDB
>> v.canlogin >> v.replication >> v.connLimit >> v.validUntil;
if (minimumVersion(90500))
col >> v.bypassRls;
return v;
}