Removed the acl field from several Pg* classes as the acl is now stored in the PgServerObject base class they inherit from.
This commit is contained in:
parent
aaa05f64ef
commit
93687df959
12 changed files with 30 additions and 30 deletions
|
|
@ -141,7 +141,7 @@ QVariant DatabasesTableModel::getData(const QModelIndex &index) const
|
|||
v = db.tablespace;
|
||||
break;
|
||||
case AclCol:
|
||||
v = db.acl;
|
||||
v = db.aclString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ QVariant TablesTableModel::getData(const QModelIndex &index) const
|
|||
case OwnerCol: return t.ownerName();
|
||||
case TablespaceCol: return getTablespaceDisplayString(*m_catalog, t.tablespace);
|
||||
case OptionsCol: break;
|
||||
case AclCol: return t.acl;
|
||||
case AclCol: return t.aclString();
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@ public:
|
|||
bool ispopulated;
|
||||
int frozenxid;
|
||||
int minmxid;
|
||||
QString acl;
|
||||
std::vector<QString> options;
|
||||
|
||||
using PgNamespaceObject::PgNamespaceObject;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ std::string PgClassContainer::getLoadQuery() const
|
|||
" relowner, relam, relfilenode, reltablespace, relpages, "
|
||||
" reltuples, reltoastrelid, relisshared, relpersistence, "
|
||||
" relkind, relhasoids, relispopulated, relfrozenxid, relminmxid, "
|
||||
" relacl, reloptions \n"
|
||||
" reloptions, relacl \n"
|
||||
"FROM pg_catalog.pg_class";
|
||||
}
|
||||
|
||||
|
|
@ -28,12 +28,12 @@ PgClass PgClassContainer::loadElem(const Pgsql::Row &row)
|
|||
>> owner >> v.am >> v.filenode >> v.tablespace >> v.pages_est
|
||||
>> v.tuples_est >> v.toastrelid >> v.isshared >> v.persistence
|
||||
>> v.kind >> v.hasoids >> v.ispopulated >> v.frozenxid >> v.minmxid
|
||||
>> v.acl >> v.options;
|
||||
>> v.options;
|
||||
v.setOwnerOid(owner);
|
||||
// auto&& ns = m_catalog.namespaces()->getByKey(v.relnamespace);
|
||||
// if (ns) {
|
||||
// v.relnamespace_name = ns->objectName();
|
||||
// v.system_namespace = ns->isSystemCatalog();
|
||||
// }
|
||||
|
||||
AclList acl_list;
|
||||
col >> acl_list;
|
||||
v.setAcls(std::move(acl_list));
|
||||
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ public:
|
|||
bool allowConn;
|
||||
int connLimit;
|
||||
Oid tablespace;
|
||||
QString acl;//"ARRAY";"YES"
|
||||
|
||||
using PgServerObject::PgServerObject;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@ PgDatabase PgDatabaseContainer::loadElem(const Pgsql::Row &row)
|
|||
QString name = col.nextValue();
|
||||
PgDatabase v(m_catalog, oid, name);
|
||||
col >> v.dba >> v.encoding >> v.collate >> v.ctype >> v.isTemplate
|
||||
>> v.allowConn >> v.connLimit >> v.tablespace >> v.acl;
|
||||
>> v.allowConn >> v.connLimit >> v.tablespace;
|
||||
|
||||
AclList acl_list;
|
||||
col >> acl_list;
|
||||
v.setAcls(std::move(acl_list));
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ public:
|
|||
Oid plcallfoid;
|
||||
Oid inline_;
|
||||
Oid validator;
|
||||
QString acl;
|
||||
|
||||
using PgDatabaseObject::PgDatabaseObject;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,13 @@ PgLanguage PgLanguageContainer::loadElem(const Pgsql::Row &row)
|
|||
Pgsql::Col col(row);
|
||||
Oid lan_oid = col.nextValue();
|
||||
QString name = col.nextValue();
|
||||
Oid owner = col.nextValue();
|
||||
PgLanguage v(m_catalog, lan_oid, name);
|
||||
col >> v.ispl >> v.pltrusted >> v.plcallfoid >> v.inline_ >> v.validator >> v.acl;
|
||||
Oid owner;
|
||||
AclList acl_list;
|
||||
col >> owner >> v.ispl >> v.pltrusted >> v.plcallfoid >> v.inline_ >> v.validator >> acl_list;
|
||||
|
||||
v.setOwnerOid(owner);
|
||||
v.setAcls(std::move(acl_list));
|
||||
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@
|
|||
/// Object representing a namespace within a database
|
||||
class PgNamespace: public PgDatabaseObject {
|
||||
public:
|
||||
Oid owner = InvalidOid;
|
||||
QString acl;
|
||||
|
||||
using PgDatabaseObject::PgDatabaseObject;
|
||||
|
||||
bool isSystemCatalog() const;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,12 @@ PgNamespace PgNamespaceContainer::loadElem(const Pgsql::Row &row)
|
|||
Oid oid = col.nextValue();
|
||||
QString name = col.nextValue();
|
||||
PgNamespace v(m_catalog, oid, name);
|
||||
col >> v.owner >> v.acl;
|
||||
Oid owner;
|
||||
AclList acl_list;
|
||||
col >> owner >> acl_list;
|
||||
v.setOwnerOid(owner);
|
||||
v.setAcls(std::move(acl_list));
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,7 @@ void operator<<(TypCategory &s, const Pgsql::Value &v);
|
|||
|
||||
class PgType: public PgNamespaceObject {
|
||||
public:
|
||||
// Oid oid = InvalidOid;
|
||||
// QString name; // formatted name as per database, arrays
|
||||
QString typname; //"name";"NO"
|
||||
// Oid typnamespace = InvalidOid;//"oid";"NO"
|
||||
// Oid owner = InvalidOid;//"oid";"NO"
|
||||
short len = -1;//"smallint";"NO"
|
||||
bool byval = false;//"boolean";"NO"
|
||||
QString type;//""char"";"NO"
|
||||
|
|
@ -60,16 +56,10 @@ public:
|
|||
Oid collation = InvalidOid;//"oid";"NO"
|
||||
QString defaultbin;//"pg_node_tree";"YES"
|
||||
QString typdefault;//"text";"YES"
|
||||
QString acl;//"ARRAY";"YES"
|
||||
|
||||
using PgNamespaceObject::PgNamespaceObject;
|
||||
|
||||
QString typeName() const override;
|
||||
|
||||
// bool operator==(Oid _oid) const { return oid == _oid; }
|
||||
// bool operator==(const QString &n) const { return name == n; }
|
||||
// bool operator<(Oid _oid) const { return oid < _oid; }
|
||||
// bool operator<(const PgType &rhs) const { return oid < rhs.oid; }
|
||||
};
|
||||
|
||||
#endif // PGTYPE_H
|
||||
|
|
|
|||
|
|
@ -22,10 +22,12 @@ PgType PgTypeContainer::loadElem(const Pgsql::Row &row)
|
|||
Oid ns_oid = col.nextValue();
|
||||
Oid owner = col.nextValue();
|
||||
PgType v(m_catalog, type_oid, name, ns_oid);
|
||||
AclList acl_list;
|
||||
col >> v.typname >> v.len >> v.byval >> v.type >> v.category
|
||||
>> v.ispreferred >> v.isdefined >> v.delim >> v.relid >> v.elem >> v.array >> v.input >> v.output
|
||||
>> v.receive >> v.send >> v.modin >> v.modout >> v.analyze >> v.align >> v.storage >> v.notnull
|
||||
>> v.basetype >> v.typmod >> v.ndims >> v.collation >> v.defaultbin >> v.typdefault >> v.acl;
|
||||
>> v.basetype >> v.typmod >> v.ndims >> v.collation >> v.defaultbin >> v.typdefault >> acl_list;
|
||||
v.setOwnerOid(owner);
|
||||
v.setAcls(std::move(acl_list));
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue