i.e. allow minetestmapper to query the database for a list of blocks in a specific range (corresponding to the requested geometry), instead of always obtaining a full list off all blocks. As postgresql is the only database which supports this efficiently, this option is only effective for postgresql.
24 lines
512 B
C++
24 lines
512 B
C++
#ifndef DB_REDIS_HEADER
|
|
#define DB_REDIS_HEADER
|
|
|
|
#include "db.h"
|
|
#include <hiredis.h>
|
|
|
|
class DBRedis : public DB {
|
|
public:
|
|
DBRedis(const std::string &mapdir);
|
|
virtual int getBlocksQueriedCount(void);
|
|
virtual int getBlocksReadCount(void);
|
|
virtual const BlockPosList &getBlockPosList();
|
|
virtual Block getBlockOnPos(const BlockPos &pos);
|
|
~DBRedis();
|
|
private:
|
|
int m_blocksReadCount;
|
|
int m_blocksQueriedCount;
|
|
redisContext *ctx;
|
|
std::string hash;
|
|
BlockPosList m_blockPosList;
|
|
};
|
|
|
|
#endif // DB_REDIS_HEADER
|