TablesTableModel now also shows (materialized) views en foreign tables.
This commit is contained in:
parent
a0579538df
commit
f0ffcf4abd
4 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public:
|
|||
enum e_Columns : int {
|
||||
NameCol, ///< either table, ns.table or table (ns) depending on settings/filters
|
||||
NamespaceCol,
|
||||
KindCol,
|
||||
OwnerCol,
|
||||
TablespaceCol,
|
||||
OptionsCol,
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ public:
|
|||
// bool operator<(Oid _oid) const { return oid < _oid; }
|
||||
// bool operator<(const PgClass &rhs) const { return oid < rhs.oid; }
|
||||
|
||||
QString kindString() const;
|
||||
QString createSql() const;
|
||||
QString typeName() const override;
|
||||
QString aclAllPattern() const override;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ std::string PgClassContainer::getLoadQuery() const
|
|||
" relkind, relhasoids, relispopulated, relfrozenxid, relminmxid, "
|
||||
" reloptions, relacl \n"
|
||||
"FROM pg_catalog.pg_class \n"
|
||||
"WHERE relkind IN ('r', 'i', 'p', 'I')";
|
||||
"WHERE relkind IN ('r', 'i', 'p', 'I', 'v', 'm', 'f')";
|
||||
}
|
||||
|
||||
PgClass PgClassContainer::loadElem(const Pgsql::Row &row)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue