Improved code generation for functions and procedures.

alter statements for configuration settings
alter statement for owner
This commit is contained in:
eelke 2018-12-23 19:45:04 +01:00
parent fc58acb252
commit 54d4dfface
5 changed files with 145 additions and 69 deletions

View file

@ -34,6 +34,24 @@ enum class ProcKind {
void operator<<(ProcKind &s, const Pgsql::Value &v);
enum class ParallelMode {
Unsafe, // u, default
Restricted, // r,
Safe // s
};
void operator<<(ParallelMode &s, const Pgsql::Value &v);
/**
* @brief parallelModeToSql
* @param pm The parallel mode
* @param explicit_unsafe When false an empty string is return for unsage when true
* a "PARALLEL UNSAFE" is returned.
* @return
*/
QString parallelModeToSql(ParallelMode pm, bool explicit_unsafe = false);
class PgProc: public PgNamespaceObject, public PgOwnedObject {
public:
using PgNamespaceObject::PgNamespaceObject;
@ -55,7 +73,7 @@ public:
bool isstrict = false; // bool
bool retset = false; // bool
char provolatile = '\0'; // char
char parallel = '\0'; // char, version >= 9.6
ParallelMode parallel = ParallelMode::Unsafe; // char, version >= 9.6
int16_t nargs = 0; // int2
int16_t nargdefaults; // = 0; // int2
Oid rettype = InvalidOid; // oid
@ -81,7 +99,7 @@ public:
// bool operator<(Oid _oid) const { return oid < _oid; }
// bool operator<(const PgProc &rhs) const { return oid < rhs.oid; }
QString createSql() const;
const QString& createSql() const;
QString argListWithNames(bool multiline = false) const;
QString argSigList(const bool forScript = false) const;