pgLab/pglablib/PgProc.h

53 lines
1.5 KiB
C
Raw Normal View History

#ifndef PGPROC_H
#define PGPROC_H
#include "PgSchemaObject.h"
#include <QString>
#include <libpq-fe.h>
#include "Pgsql_Value.h"
class PgProc: public PgSchemaObject {
public:
using PgSchemaObject::PgSchemaObject;
Oid oid = InvalidOid; // oid
QString name; // name
// Oid pronamespace = InvalidOid; // oid, namespace
Oid owner = InvalidOid; // oid
Oid lang = InvalidOid; // oid
float cost = 0.f; // float4
float rows = 0.f; // float4
Oid variadic = InvalidOid; // oid
QString transform; // regproc
bool isagg = false; // bool
bool iswindow = false; // bool
bool secdef = false; // bool
bool leakproof = false; // bool
bool isstrict = false; // bool
bool retset = false; // bool
char provolatile = '\0'; // char
char parallel = '\0'; // char, version >= 9.6
int16_t nargs = 0; // int2
int16_t nargdefaults = 0; // int2
Oid rettype = InvalidOid; // oid
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
std::vector<Oid> trftypes; // oid[], version >= 9.5
QString src; // text
QString bin; // text
std::vector<QString> config; // text[]
std::vector<QString> acl; // aclitem[]
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 PgProc &rhs) const { return oid < rhs.oid; }
virtual QString objectName() const override;
};
#endif // PGPROC_H