mirror of
https://github.com/minetest/minetestmapper.git
synced 2025-07-02 00:20:22 +02:00
Move include files
This commit is contained in:
29
include/db-postgresql.h
Normal file
29
include/db-postgresql.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef _DB_POSTGRESQL_H
|
||||
#define _DB_POSTGRESQL_H
|
||||
|
||||
#include "db.h"
|
||||
#include <libpq-fe.h>
|
||||
|
||||
class DBPostgreSQL : public DB {
|
||||
public:
|
||||
DBPostgreSQL(const std::string &mapdir);
|
||||
virtual std::vector<BlockPos> getBlockPos();
|
||||
virtual void getBlocksOnZ(std::map<int16_t, BlockList> &blocks, int16_t zPos);
|
||||
virtual ~DBPostgreSQL();
|
||||
protected:
|
||||
PGresult *checkResults(PGresult *res, bool clear = true);
|
||||
void prepareStatement(const std::string &name, const std::string &sql);
|
||||
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
|
||||
);
|
||||
int pg_to_int(PGresult *res, int row, int col);
|
||||
int pg_binary_to_int(PGresult *res, int row, int col);
|
||||
BlockPos pg_to_blockpos(PGresult *res, int row, int col);
|
||||
private:
|
||||
PGconn *db;
|
||||
};
|
||||
|
||||
#endif // _DB_POSTGRESQL_H
|
Reference in New Issue
Block a user