pgLab/pglablib/PgClass.cpp

57 lines
869 B
C++
Raw Normal View History

#include "PgClass.h"
void operator<<(RelPersistence &s, const Pgsql::Value &v)
{
//s = static_cast<T>(v);
const char *c = v.c_str();
switch (*c) {
case 'p':
s = RelPersistence::Permanent;
break;
case 'u':
s = RelPersistence::Unlogged;
break;
case 't':
s = RelPersistence::Temporary;
break;
}
}
void operator<<(RelKind &s, const Pgsql::Value &v)
{
//s = static_cast<T>(v);
const char *c = v.c_str();
switch (*c) {
case 'r':
s = RelKind::Table;
break;
case 'i':
s = RelKind::Index;
break;
case 'S':
s = RelKind::Sequence;
break;
case 'v':
s = RelKind::View;
break;
case 'm':
s = RelKind::MaterializedView;
break;
case 'c':
s = RelKind::Composite;
break;
case 't':
s = RelKind::Toast;
break;
case 'f':
s = RelKind::ForeignTable;
break;
}
}
//QString PgClass::objectName() const
//{
// return name;
//}