75 lines
1.1 KiB
C
75 lines
1.1 KiB
C
|
|
#ifndef DBSCHEMA_DATABASE_H
|
|||
|
|
#define DBSCHEMA_DATABASE_H
|
|||
|
|
|
|||
|
|
#include <QDateTime>
|
|||
|
|
#include <QString>
|
|||
|
|
#include <map>
|
|||
|
|
|
|||
|
|
|
|||
|
|
namespace dbschema {
|
|||
|
|
|
|||
|
|
class Role {
|
|||
|
|
public:
|
|||
|
|
int oid;
|
|||
|
|
QString rolname;
|
|||
|
|
bool super;
|
|||
|
|
bool inherit;
|
|||
|
|
bool createrole;
|
|||
|
|
bool createdb;
|
|||
|
|
bool canlogin;
|
|||
|
|
bool replication;
|
|||
|
|
bool bypassRls;
|
|||
|
|
int connLimit;
|
|||
|
|
QDateTime validUntil;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class Server {
|
|||
|
|
public:
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
using t_RoleList = std::map<int, Role*>;
|
|||
|
|
// tablespaces
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class Schema {
|
|||
|
|
int oid;
|
|||
|
|
QString schema;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class Table {
|
|||
|
|
public:
|
|||
|
|
int oid;
|
|||
|
|
Schema *schema;
|
|||
|
|
QString tableName;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
/** Holds all the definitions from a single database
|
|||
|
|
|
|||
|
|
This class is responsible for cleaning up all dynamically allocated objects.
|
|||
|
|
*/
|
|||
|
|
class Database {
|
|||
|
|
public:
|
|||
|
|
Database();
|
|||
|
|
~Database();
|
|||
|
|
|
|||
|
|
Database(const Database &) = delete;
|
|||
|
|
Database& operator=(const Database &) = delete;
|
|||
|
|
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
|
|||
|
|
using t_SchemaList = std::map<int, Schema*>;
|
|||
|
|
using t_TableList = std::map<int, Table*>;
|
|||
|
|
|
|||
|
|
t_SchemaList m_schemas; // Alphabetically ordered
|
|||
|
|
t_TableList m_tables;
|
|||
|
|
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#endif // DBSCHEMA_DATABASE_H
|