mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add mod storage PostgreSQL backend
This commit is contained in:
parent
9dbac989bd
commit
aaa05f901a
4 changed files with 315 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue