2017-12-17 11:28:20 +01:00
|
|
|
|
#include "PgIndex.h"
|
2018-08-25 18:11:12 +02:00
|
|
|
|
#include "PgDatabaseCatalog.h"
|
|
|
|
|
|
#include "PgClassContainer.h"
|
|
|
|
|
|
#include "PgAmContainer.h"
|
2017-12-16 21:43:51 +01:00
|
|
|
|
|
2017-12-17 11:28:20 +01:00
|
|
|
|
PgIndex::PgIndex() = default;
|
2018-08-25 18:11:12 +02:00
|
|
|
|
|
|
|
|
|
|
PgIndex::PgIndex(std::weak_ptr<PgDatabaseCatalog> cat)
|
|
|
|
|
|
: PgObject(cat)
|
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
QString PgIndex::getAm() const
|
|
|
|
|
|
{
|
|
|
|
|
|
auto cat = catalog.lock();
|
|
|
|
|
|
QString result;
|
|
|
|
|
|
if (cat) {
|
|
|
|
|
|
auto idxcls = cat->classes()->getByKey(indexrelid);
|
|
|
|
|
|
auto am = cat->ams()->getByKey(idxcls.am);
|
|
|
|
|
|
result = am.name;
|
|
|
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
|
|
|
}
|