0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 02:02:38 +01:00

modules/console: Fix and improve db compact cmd.

This commit is contained in:
Jason Volk 2018-09-19 17:03:38 -07:00
parent c1a2e44ce0
commit 65882b7afb

View file

@ -1196,19 +1196,19 @@ try
param[1] param[1]
}; };
const auto begin const auto level
{ {
param[2] param.at(2, -1)
}; };
const auto end const auto begin
{ {
param[3] param[3]
}; };
const auto level const auto end
{ {
param.at(4, -1) param[4]
}; };
auto &database auto &database
@ -1233,14 +1233,23 @@ try
begin? try_lex_cast<uint64_t>(begin) : false begin? try_lex_cast<uint64_t>(begin) : false
}; };
const std::pair<string_view, string_view> range const uint64_t integers[2]
{ {
integer? byte_view<string_view>(lex_cast<uint64_t>(begin)) : begin, integer? lex_cast<uint64_t>(begin) : 0,
integer && end? byte_view<string_view>(lex_cast<uint64_t>(end)) : end, integer && end? lex_cast<uint64_t>(end) : 0
}; };
compact(column, range, level); const std::pair<string_view, string_view> range
{
integer? byte_view<string_view>(integers[0]) : begin,
integer && end? byte_view<string_view>(integers[1]) : end,
};
compact(column, range);
if(level > -2)
compact(column, level); compact(column, level);
out << "done" << std::endl; out << "done" << std::endl;
return true; return true;
} }