Reorganize files in pglablib
The enitities and containers of the catalog now go into catalog subfolder Models go into model
This commit is contained in:
parent
56cbeea183
commit
f0c1035378
121 changed files with 226 additions and 183 deletions
59
pglablib/catalog/PgProcContainer.cpp
Normal file
59
pglablib/catalog/PgProcContainer.cpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#include "PgProcContainer.h"
|
||||
#include "Pgsql_Connection.h"
|
||||
#include "Pgsql_Col.h"
|
||||
#include "PgDatabaseCatalog.h"
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
std::string PgProcContainer::getLoadQuery() const
|
||||
{
|
||||
std::string column_list =
|
||||
"oid,proname,pronamespace,proowner,prolang,procost,prorows,"
|
||||
"provariadic,protransform,proisagg,proiswindow,prosecdef,proleakproof,"
|
||||
"proisstrict,proretset,provolatile,pronargs,pronargdefaults,prorettype,"
|
||||
"proargtypes,proallargtypes,proargmodes,proargnames,proargdefaults,"
|
||||
"prosrc,probin,proconfig,proacl";
|
||||
if (minimumVersion(90500)) {
|
||||
column_list += ",protrftypes";
|
||||
}
|
||||
if (minimumVersion(90600)) {
|
||||
column_list += ",proparallel";
|
||||
}
|
||||
|
||||
return "SELECT " + column_list + " FROM pg_proc";
|
||||
}
|
||||
|
||||
PgProc PgProcContainer::loadElem(const Pgsql::Row &row)
|
||||
{
|
||||
Pgsql::Col col(row);
|
||||
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.getAsVector<Oid>(std::back_inserter(argtypes));
|
||||
col >> allargtypes >> argmodes >> argnames >> argdefaults
|
||||
>> v.src >> v.bin >> v.config >> v.acl;
|
||||
|
||||
v.setArgs(argtypes, allargtypes, argmodes, argnames, argdefaults);
|
||||
|
||||
if (minimumVersion(90500)) {
|
||||
col >> v.trftypes;
|
||||
}
|
||||
if (minimumVersion(90600)) {
|
||||
col >> v.parallel;
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue