2017-02-12 14:03:42 +01:00
|
|
|
|
#ifndef PGDATABASE_H
|
|
|
|
|
|
#define PGDATABASE_H
|
|
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
#include "PgServerObject.h"
|
2017-02-12 14:03:42 +01:00
|
|
|
|
#include <QString>
|
2017-08-23 13:27:23 +02:00
|
|
|
|
#include <libpq-fe.h>
|
2017-02-12 14:03:42 +01:00
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
class PgDatabase: public PgServerObject {
|
2017-02-12 14:03:42 +01:00
|
|
|
|
public:
|
|
|
|
|
|
|
2022-05-24 18:54:13 +02:00
|
|
|
|
int encoding = 0;
|
2021-03-10 20:49:03 +01:00
|
|
|
|
QString encodingString;
|
2017-02-12 14:03:42 +01:00
|
|
|
|
QString collate;
|
|
|
|
|
|
QString ctype;
|
2022-05-24 18:54:13 +02:00
|
|
|
|
QString dbTemplate; ///< Not stored in the catalog but can be present in CREATE DATABASE statement
|
|
|
|
|
|
bool isTemplate = false;
|
|
|
|
|
|
bool allowConn = true;
|
|
|
|
|
|
int connLimit = -1;
|
|
|
|
|
|
Oid tablespace = InvalidOid;
|
2017-02-12 14:03:42 +01:00
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
using PgServerObject::PgServerObject;
|
2017-02-12 14:03:42 +01:00
|
|
|
|
|
2018-11-25 19:45:06 +01:00
|
|
|
|
bool isValid() const { return oid() != InvalidOid; }
|
|
|
|
|
|
|
2018-12-24 11:31:56 +01:00
|
|
|
|
QString typeName() const override;
|
2022-01-20 20:13:56 +01:00
|
|
|
|
virtual QString aclAllPattern() const override;
|
|
|
|
|
|
virtual QString dropSql() const override;
|
|
|
|
|
|
virtual QString createSql() const override;
|
2017-02-12 14:03:42 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PGDATABASE_H
|