Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
PlayerDatabasePostgreSQL Class Reference

#include <database-postgresql.h>

+ Inheritance diagram for PlayerDatabasePostgreSQL:
+ Collaboration diagram for PlayerDatabasePostgreSQL:

Public Member Functions

 PlayerDatabasePostgreSQL (const std::string &connect_string)
 
virtual ~PlayerDatabasePostgreSQL ()=default
 
void savePlayer (RemotePlayer *player)
 
bool loadPlayer (RemotePlayer *player, PlayerSAO *sao)
 
bool removePlayer (const std::string &name)
 
void listPlayers (std::vector< std::string > &res)
 
- Public Member Functions inherited from PlayerDatabase
virtual ~PlayerDatabase ()=default
 

Protected Member Functions

virtual void createDatabase ()
 
virtual void initStatements ()
 

Private Member Functions

bool playerDataExists (const std::string &playername)
 
- Private Member Functions inherited from Database_PostgreSQL
 Database_PostgreSQL (const std::string &connect_string, const char *type)
 
 ~Database_PostgreSQL ()
 
void beginSave ()
 
void endSave ()
 
void rollback ()
 
bool initialized () const
 
int pg_to_int (PGresult *res, int row, int col)
 
u32 pg_to_uint (PGresult *res, int row, int col)
 
float pg_to_float (PGresult *res, int row, int col)
 
v3s16 pg_to_v3s16 (PGresult *res, int row, int col)
 
std::string pg_to_string (PGresult *res, int row, int col)
 
PGresult * execPrepared (const char *stmtName, const int paramsNumber, const void **params, const int *paramsLengths=NULL, const int *paramsFormats=NULL, bool clear=true, bool nobinary=true)
 
PGresult * execPrepared (const char *stmtName, const int paramsNumber, const char **params, bool clear=true, bool nobinary=true)
 
void createTableIfNotExists (const std::string &table_name, const std::string &definition)
 
void verifyDatabase ()
 
void connectToDatabase ()
 
void prepareStatement (const std::string &name, const std::string &sql)
 
int getPGVersion () const
 

Constructor & Destructor Documentation

◆ PlayerDatabasePostgreSQL()

PlayerDatabasePostgreSQL::PlayerDatabasePostgreSQL ( const std::string & connect_string)

◆ ~PlayerDatabasePostgreSQL()

virtual PlayerDatabasePostgreSQL::~PlayerDatabasePostgreSQL ( )
virtualdefault

Member Function Documentation

◆ createDatabase()

virtual void PlayerDatabasePostgreSQL::createDatabase ( )
protectedvirtual

Implements Database_PostgreSQL.

◆ initStatements()

virtual void PlayerDatabasePostgreSQL::initStatements ( )
protectedvirtual

Implements Database_PostgreSQL.

◆ listPlayers()

void PlayerDatabasePostgreSQL::listPlayers ( std::vector< std::string > & res)
virtual

Implements PlayerDatabase.

◆ loadPlayer()

bool PlayerDatabasePostgreSQL::loadPlayer ( RemotePlayer * player,
PlayerSAO * sao )
virtual

Implements PlayerDatabase.

◆ playerDataExists()

bool PlayerDatabasePostgreSQL::playerDataExists ( const std::string & playername)
private

◆ removePlayer()

bool PlayerDatabasePostgreSQL::removePlayer ( const std::string & name)
virtual

Implements PlayerDatabase.

◆ savePlayer()

void PlayerDatabasePostgreSQL::savePlayer ( RemotePlayer * player)
virtual

Implements PlayerDatabase.


The documentation for this class was generated from the following file: