mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Add mod storage PostgreSQL backend
This commit is contained in:
committed by
Loïc Blot
parent
9dbac989bd
commit
aaa05f901a
@@ -67,6 +67,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
#include "server/serverinventorymgr.h"
|
||||
#include "translation.h"
|
||||
#include "database/database-sqlite3.h"
|
||||
#if USE_POSTGRESQL
|
||||
#include "database/database-postgresql.h"
|
||||
#endif
|
||||
#include "database/database-files.h"
|
||||
#include "database/database-dummy.h"
|
||||
#include "gameparams.h"
|
||||
@@ -4025,6 +4028,14 @@ ModMetadataDatabase *Server::openModStorageDatabase(const std::string &backend,
|
||||
if (backend == "sqlite3")
|
||||
return new ModMetadataDatabaseSQLite3(world_path);
|
||||
|
||||
#if USE_POSTGRESQL
|
||||
if (backend == "postgresql") {
|
||||
std::string connect_string;
|
||||
world_mt.getNoEx("pgsql_mod_storage_connection", connect_string);
|
||||
return new ModMetadataDatabasePostgreSQL(connect_string);
|
||||
}
|
||||
#endif // USE_POSTGRESQL
|
||||
|
||||
if (backend == "files")
|
||||
return new ModMetadataDatabaseFiles(world_path);
|
||||
|
||||
|
Reference in New Issue
Block a user