aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/position.cpp
blob: 409a593b44ccd06d8801daf1ef650e61a7366a0e (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
#include "FunctionsStringSearch.h"
#include "FunctionFactory.h"
#include "PositionImpl.h"


namespace DB
{
namespace
{

struct NamePosition
{
    static constexpr auto name = "position";
};

using FunctionPosition = FunctionsStringSearch<PositionImpl<NamePosition, PositionCaseSensitiveASCII>>;

}

REGISTER_FUNCTION(Position)
{
    factory.registerFunction<FunctionPosition>({}, FunctionFactory::CaseInsensitive);
    factory.registerAlias("locate", NamePosition::name, FunctionFactory::CaseInsensitive);
}
}