Rework of catalog objects. Several of them are now inheriting from common

base classes that implement common functionality.
This commit is contained in:
eelke 2018-11-25 19:45:06 +01:00
parent 840af1e0a9
commit 73c4cf4790
45 changed files with 340 additions and 265 deletions

View file

@ -26,23 +26,26 @@ std::string PgProcContainer::getLoadQuery() const
PgProc PgProcContainer::loadElem(const Pgsql::Row &row)
{
Pgsql::Col col(row);
PgProc v(m_catalog);
Oid namespace_oid;
Oid oid = col.nextValue();
QString name = col.nextValue();
Oid namespace_oid = col.nextValue();
PgProc v(m_catalog, oid, name, namespace_oid);
col >> v.owner >> v.lang >> v.cost >> v.rows
>> v.variadic >> v.transform >> v.isagg >> v.iswindow >> v.secdef >> v.leakproof
>> v.isstrict >> v.retset >> v.provolatile >> v.nargs >> v.nargdefaults
>> v.rettype;
std::vector<Oid> argtypes; // oid[]
std::vector<Oid> allargtypes; // oid[]
std::vector<char> argmodes; // char[]
std::vector<QString> argnames; // text[]
std::optional<QString> argdefaults; // pg_node_tree
col >> v.oid >> v.name >> namespace_oid >> v.owner >> v.lang >> v.cost >> v.rows
>> v.variadic >> v.transform >> v.isagg >> v.iswindow >> v.secdef >> v.leakproof
>> v.isstrict >> v.retset >> v.provolatile >> v.nargs >> v.nargdefaults
>> v.rettype;
col.getAsVector<Oid>(std::back_inserter(argtypes));
col >> allargtypes >> argmodes >> argnames >> argdefaults
>> v.src >> v.bin >> v.config >> v.acl;
v.setSchemaOid(namespace_oid);
v.setArgs(argtypes, allargtypes, argmodes, argnames, argdefaults);
if (minimumVersion(90500)) {