1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Implement a PostgreSQL backend

This commit is contained in:
Loic Blot 2016-05-14 11:00:42 +02:00
parent 0f184d77c8
commit ce42ff9cf7
7 changed files with 433 additions and 2 deletions

View file

@ -50,6 +50,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#if USE_REDIS
#include "database-redis.h"
#endif
#if USE_POSTGRESQL
#include "database-postgresql.h"
#endif
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
@ -3240,6 +3243,10 @@ Database *ServerMap::createDatabase(
else if (name == "redis")
return new Database_Redis(conf);
#endif
#if USE_POSTGRESQL
else if (name == "postgresql")
return new Database_PostgreSQL(conf);
#endif
else
throw BaseException(std::string("Database backend ") + name + " not supported.");
}