mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2024-11-29 01:33:46 +00:00
Put LIMIT number into a common header.
This commit is contained in:
parent
dfe3655296
commit
0cb91fb9ca
3 changed files with 29 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
||||||
#include "locate.hpp"
|
#include "locate.hpp"
|
||||||
#include "dindexer-machinery/recorddata.hpp"
|
#include "dindexer-machinery/recorddata.hpp"
|
||||||
#include "pq/connection.hpp"
|
#include "pq/connection.hpp"
|
||||||
|
#include "query_count_limit.hpp"
|
||||||
#include "dindexer-machinery/tiger.hpp"
|
#include "dindexer-machinery/tiger.hpp"
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
|
|
||||||
namespace dindb {
|
namespace dindb {
|
||||||
namespace {
|
namespace {
|
||||||
const int g_max_results = 200;
|
const int g_max_results = g_query_count_limit;
|
||||||
|
|
||||||
std::vector<LocatedSet> sets_result_to_vec (pq::ResultSet&& parResult) {
|
std::vector<LocatedSet> sets_result_to_vec (pq::ResultSet&& parResult) {
|
||||||
using boost::lexical_cast;
|
using boost::lexical_cast;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "navigate.hpp"
|
#include "navigate.hpp"
|
||||||
#include "pq/connection.hpp"
|
#include "pq/connection.hpp"
|
||||||
#include "helpers/infix_iterator.hpp"
|
#include "helpers/infix_iterator.hpp"
|
||||||
|
#include "query_count_limit.hpp"
|
||||||
#include <ciso646>
|
#include <ciso646>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
@ -27,7 +28,7 @@
|
||||||
|
|
||||||
namespace dindb {
|
namespace dindb {
|
||||||
namespace {
|
namespace {
|
||||||
const uint32_t g_files_query_limit = 500;
|
const uint32_t g_files_query_limit = g_query_count_limit;
|
||||||
|
|
||||||
std::ostream& operator<< (std::ostream& parOut, const std::vector<std::string>& parCols) {
|
std::ostream& operator<< (std::ostream& parOut, const std::vector<std::string>& parCols) {
|
||||||
parOut << '"';
|
parOut << '"';
|
||||||
|
|
25
src/backends/postgresql/query_count_limit.hpp
Normal file
25
src/backends/postgresql/query_count_limit.hpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/* Copyright 2015, 2016, Michele Santullo
|
||||||
|
* This file is part of "dindexer".
|
||||||
|
*
|
||||||
|
* "dindexer" is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* "dindexer" is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef id367C9335A3444BC0846EF4E2A27AB9A9
|
||||||
|
#define id367C9335A3444BC0846EF4E2A27AB9A9
|
||||||
|
|
||||||
|
namespace dindb {
|
||||||
|
constexpr const uint32_t g_query_count_limit = 500;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in a new issue