28 lines
959 B
C++
28 lines
959 B
C++
#include "PgIndexContainer.h"
|
|
#include "Pgsql_Col.h"
|
|
#include <iterator>
|
|
|
|
std::string PgIndexContainer::getLoadQuery() const
|
|
{
|
|
return R"__(
|
|
SELECT indexrelid, indrelid, indnatts, indisunique, indisprimary,
|
|
indisexclusion, indimmediate, indisclustered, indisvalid,
|
|
indcheckxmin, indisready, indislive, indisreplident, indkey,
|
|
indcollation, indclass, indoption, indexprs, indpred
|
|
FROM pg_index)__";
|
|
}
|
|
|
|
PgIndex PgIndexContainer::loadElem(const Pgsql::Row &row)
|
|
{
|
|
Pgsql::Col col(row);
|
|
PgIndex v;
|
|
col >> v.indexrelid >> v.relid >> v.natts >> v.isunique
|
|
>> v.isprimary >> v.isexclusion >> v.immediate >> v.isclustered
|
|
>> v.isvalid >> v.checkxmin >> v.isready >> v.islive >> v.isreplident;
|
|
col.getAsVector<int16_t>(std::back_inserter(v.key));
|
|
col.getAsVector<Oid>(std::back_inserter(v.collation));
|
|
col.getAsVector<Oid>(std::back_inserter(v.indclass));
|
|
col.getAsVector<int16_t>(std::back_inserter(v.option));
|
|
col >> v.exprs >> v.pred;
|
|
return v;
|
|
}
|