summaryrefslogtreecommitdiff
path: root/src/database/database-postgresql.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/database-postgresql.h')
-rw-r--r--src/database/database-postgresql.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/database/database-postgresql.h b/src/database/database-postgresql.h
index 5a8b89a51..340f0a7b8 100644
--- a/src/database/database-postgresql.h
+++ b/src/database/database-postgresql.h
@@ -36,6 +36,7 @@ public:
void beginSave();
void endSave();
+ void rollback();
bool initialized() const;
@@ -148,3 +149,26 @@ protected:
private:
bool playerDataExists(const std::string &playername);
};
+
+class AuthDatabasePostgreSQL : private Database_PostgreSQL, public AuthDatabase
+{
+public:
+ AuthDatabasePostgreSQL(const std::string &connect_string);
+ virtual ~AuthDatabasePostgreSQL() = default;
+
+ virtual void pingDatabase() { Database_PostgreSQL::pingDatabase(); }
+
+ virtual bool getAuth(const std::string &name, AuthEntry &res);
+ virtual bool saveAuth(const AuthEntry &authEntry);
+ virtual bool createAuth(AuthEntry &authEntry);
+ virtual bool deleteAuth(const std::string &name);
+ virtual void listNames(std::vector<std::string> &res);
+ virtual void reload();
+
+protected:
+ virtual void createDatabase();
+ virtual void initStatements();
+
+private:
+ virtual void writePrivileges(const AuthEntry &authEntry);
+};