mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
modules/console: Support sst dumping all columns.
This commit is contained in:
parent
3de9464058
commit
1dad409311
1 changed files with 26 additions and 12 deletions
|
@ -2014,7 +2014,7 @@ console_cmd__db__sst__dump(opt &out, const string_view &line)
|
|||
|
||||
const auto colname
|
||||
{
|
||||
param.at("column")
|
||||
param.at("column", "*"_sv)
|
||||
};
|
||||
|
||||
const auto begin
|
||||
|
@ -2037,18 +2037,32 @@ console_cmd__db__sst__dump(opt &out, const string_view &line)
|
|||
db::database::get(dbname)
|
||||
};
|
||||
|
||||
db::column column
|
||||
{
|
||||
database, colname
|
||||
};
|
||||
|
||||
const db::database::sst::dump dump
|
||||
{
|
||||
column, {begin, end}, path
|
||||
};
|
||||
|
||||
_print_sst_info_header(out);
|
||||
_print_sst_info(out, dump.info);
|
||||
|
||||
const auto do_dump{[&](const string_view &colname)
|
||||
{
|
||||
db::column column
|
||||
{
|
||||
database, colname
|
||||
};
|
||||
|
||||
const db::database::sst::dump dump
|
||||
{
|
||||
column, {begin, end}, path
|
||||
};
|
||||
|
||||
_print_sst_info(out, dump.info);
|
||||
}};
|
||||
|
||||
if(colname != "*")
|
||||
{
|
||||
do_dump(colname);
|
||||
return true;
|
||||
}
|
||||
|
||||
for(const auto &colname : database.column_names)
|
||||
do_dump(colname);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue