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

#include <database-postgresql.h>

+ Inheritance diagram for MapDatabasePostgreSQL:
+ Collaboration diagram for MapDatabasePostgreSQL:

Public Member Functions

 MapDatabasePostgreSQL (const std::string &connect_string)
 
virtual ~MapDatabasePostgreSQL ()=default
 
bool saveBlock (const v3s16 &pos, std::string_view data)
 
void loadBlock (const v3s16 &pos, std::string *block)
 
bool deleteBlock (const v3s16 &pos)
 
void listAllLoadableBlocks (std::vector< v3s16 > &dst)
 
void beginSave ()
 
void endSave ()
 
- Public Member Functions inherited from MapDatabase
virtual ~MapDatabase ()=default
 

Protected Member Functions

virtual void createDatabase ()
 
virtual void initStatements ()
 

Additional Inherited Members

- Static Public Member Functions inherited from MapDatabase
static s64 getBlockAsInteger (const v3s16 &pos)
 
static v3s16 getIntegerAsBlock (s64 i)
 
- Private Member Functions inherited from Database_PostgreSQL
 Database_PostgreSQL (const std::string &connect_string, const char *type)
 
 ~Database_PostgreSQL ()
 
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

◆ MapDatabasePostgreSQL()

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

◆ ~MapDatabasePostgreSQL()

virtual MapDatabasePostgreSQL::~MapDatabasePostgreSQL ( )
virtualdefault

Member Function Documentation

◆ beginSave()

void MapDatabasePostgreSQL::beginSave ( )
inlinevirtual

Reimplemented from Database_PostgreSQL.

References Database_PostgreSQL::beginSave().

+ Here is the call graph for this function:

◆ createDatabase()

virtual void MapDatabasePostgreSQL::createDatabase ( )
protectedvirtual

Implements Database_PostgreSQL.

◆ deleteBlock()

bool MapDatabasePostgreSQL::deleteBlock ( const v3s16 & pos)
virtual

Implements MapDatabase.

◆ endSave()

void MapDatabasePostgreSQL::endSave ( )
inlinevirtual

Reimplemented from Database_PostgreSQL.

References Database_PostgreSQL::endSave().

+ Here is the call graph for this function:

◆ initStatements()

virtual void MapDatabasePostgreSQL::initStatements ( )
protectedvirtual

Implements Database_PostgreSQL.

◆ listAllLoadableBlocks()

void MapDatabasePostgreSQL::listAllLoadableBlocks ( std::vector< v3s16 > & dst)
virtual

Implements MapDatabase.

◆ loadBlock()

void MapDatabasePostgreSQL::loadBlock ( const v3s16 & pos,
std::string * block )
virtual

Implements MapDatabase.

◆ saveBlock()

bool MapDatabasePostgreSQL::saveBlock ( const v3s16 & pos,
std::string_view data )
virtual

Implements MapDatabase.


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