ClickHouse/src/Databases/LoadingStrictnessLevel.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
553 B
C++
Raw Normal View History

2022-07-20 20:54:43 +00:00
#include <Databases/LoadingStrictnessLevel.h>
2022-07-21 18:32:33 +00:00
#include <cassert>
2022-07-20 20:54:43 +00:00
namespace DB
{
LoadingStrictnessLevel getLoadingStrictnessLevel(bool attach, bool force_attach, bool force_restore)
{
if (force_restore)
{
assert(attach);
assert(force_attach);
return LoadingStrictnessLevel::FORCE_RESTORE;
}
if (force_attach)
{
assert(attach);
return LoadingStrictnessLevel::FORCE_ATTACH;
}
if (attach)
return LoadingStrictnessLevel::ATTACH;
return LoadingStrictnessLevel::CREATE;
}
}