Added typeName function to PgObject as it might be useful for building generic functions.

This commit is contained in:
eelke 2018-12-24 11:31:56 +01:00
parent b210c570fc
commit 3f337b2cca
21 changed files with 83 additions and 15 deletions

View file

@ -73,6 +73,21 @@ QString PgClass::createSql() const
return createSqlCache;
}
QString PgClass::typeName() const
{
switch (kind) {
case RelKind::Table: return "TABLE";
case RelKind::Index: return "INDEX";
case RelKind::Sequence: return "SEQUENCE";
case RelKind::View: return "VIEW";
case RelKind::MaterializedView: return "MATERIALIZED VIEW";
case RelKind::Composite: return "COMPOSITE";
case RelKind::Toast: return "TOAST";
case RelKind::ForeignTable: return "FOREIGN TABLE";
}
throw std::runtime_error("Unexpected value in PgClass::typeName()");
}
QString PgClass::createTableSql() const
{
QString sql;