mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
modules/console: Add db check cmd.
This commit is contained in:
parent
96da6a3486
commit
918815a874
1 changed files with 26 additions and 0 deletions
|
@ -1840,6 +1840,32 @@ catch(const std::out_of_range &e)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__db__check(opt &out, const string_view &line)
|
||||
try
|
||||
{
|
||||
const auto dbname
|
||||
{
|
||||
token(line, ' ', 0)
|
||||
};
|
||||
|
||||
auto &database
|
||||
{
|
||||
db::database::get(dbname)
|
||||
};
|
||||
|
||||
check(database);
|
||||
out << "Check of " << dbname << " completed without error."
|
||||
<< std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
catch(const std::out_of_range &e)
|
||||
{
|
||||
out << "No open database by that name" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
console_cmd__db__list(opt &out, const string_view &line)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue