mirror of
https://github.com/matrix-construct/construct
synced 2024-10-02 21:59:02 +02:00
modules/console: Add db command to list files.
This commit is contained in:
parent
2bce600a60
commit
86b0f8248f
1 changed files with 34 additions and 0 deletions
|
@ -518,6 +518,40 @@ console_cmd__db__prop(opt &out, const string_view &line)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__db__files(opt &out, const string_view &line)
|
||||
try
|
||||
{
|
||||
const auto dbname
|
||||
{
|
||||
token(line, ' ', 0)
|
||||
};
|
||||
|
||||
auto &database
|
||||
{
|
||||
*db::database::dbs.at(dbname)
|
||||
};
|
||||
|
||||
uint64_t msz;
|
||||
const auto files
|
||||
{
|
||||
db::files(database, msz)
|
||||
};
|
||||
|
||||
for(const auto &file : files)
|
||||
out << file << std::endl;
|
||||
|
||||
out << "-- " << files.size() << " files; "
|
||||
<< "manifest is " << msz << " bytes.";
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(const std::out_of_range &e)
|
||||
{
|
||||
out << "No open database by that name" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__db__txns(opt &out, const string_view &line)
|
||||
try
|
||||
|
|
Loading…
Reference in a new issue