aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Common/KnownObjectNames.h
blob: f003af69904155dde6c121a20b725becda62a7b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#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();
};

}