Rogier 03926420d0 Implement bounded block-list query for postgresql
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.
2016-01-17 10:37:51 +01:00

25 lines
560 B
C++

#ifndef _DB_H
#define _DB_H
#include <cstdint>
#include <vector>
#include <string>
#include <utility>
#include "types.h"
#include "BlockPos.h"
class DB {
public:
typedef std::pair<BlockPos, ustring> Block;
typedef std::vector<BlockPos> BlockPosList;
virtual const BlockPosList &getBlockPosList()=0;
virtual const BlockPosList &getBlockPosList(BlockPos, BlockPos) { return getBlockPosList(); }
virtual int getBlocksQueriedCount(void)=0;
virtual int getBlocksReadCount(void)=0;
virtual Block getBlockOnPos(const BlockPos &pos)=0;
};
#endif // _DB_H