mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
38 lines
606 B
C++
38 lines
606 B
C++
#pragma once
|
|
|
|
#include <base/types.h>
|
|
#include <mutex>
|
|
#include <unordered_set>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class KnownObjectNames
|
|
{
|
|
public:
|
|
bool exists(const String & name) const;
|
|
void add(const String & name, bool case_insensitive = false);
|
|
|
|
private:
|
|
mutable std::mutex mutex;
|
|
std::unordered_set<String> names;
|
|
std::unordered_set<String> case_insensitive_names;
|
|
};
|
|
|
|
|
|
class KnownTableFunctionNames : public KnownObjectNames
|
|
{
|
|
public:
|
|
static KnownTableFunctionNames & instance();
|
|
};
|
|
|
|
|
|
class KnownFormatNames : public KnownObjectNames
|
|
{
|
|
public:
|
|
static KnownFormatNames & instance();
|
|
};
|
|
|
|
}
|