TablesTableModel now also shows (materialized) views en foreign tables.

This commit is contained in:
eelke 2018-12-29 11:19:12 +01:00
parent a0579538df
commit f0ffcf4abd
4 changed files with 8 additions and 2 deletions

View file

@ -40,7 +40,8 @@ void TablesTableModel::reloadData()
m_tables.clear();
for (const auto &e : *classes) {
bool add = false;
if (e.kind == RelKind::Table) {
if (e.kind == RelKind::Table || e.kind == RelKind::View
|| e.kind == RelKind::MaterializedView || e.kind == RelKind::ForeignTable) {
switch (m_namespaceFilter) {
case TablesTableModel::User:
add = !e.ns().isSystemCatalog();
@ -121,6 +122,7 @@ QVariant TablesTableModel::headerData(int section, Qt::Orientation orientation,
switch (section) {
case NameCol: return tr("Name");
case NamespaceCol: return tr("Schema");
case KindCol: return tr("Kind");
case OwnerCol: return tr("Owner");
case TablespaceCol: return tr("Tablespace");
case OptionsCol: return tr("Options");
@ -150,6 +152,7 @@ Oid TablesTableModel::getType(int column) const
case OwnerCol:
case NameCol:
case NamespaceCol:
case KindCol:
case OptionsCol:
case AclCol:
default:
@ -164,6 +167,7 @@ QVariant TablesTableModel::getData(const QModelIndex &index) const
switch (index.column()) {
case NameCol: return t.objectName();
case NamespaceCol: return t.nsName();
case KindCol: return t.typeName();
case OwnerCol: return t.ownerName();
case TablespaceCol: return getTablespaceDisplayString(*m_catalog, t.tablespace);
case OptionsCol: break;