#include #include #include namespace DB { void registerDataTypeDomainIPv4AndIPv6(DataTypeFactory & factory) { factory.registerSimpleDataTypeCustom("IPv4", [] { auto type = DataTypeFactory::instance().get("UInt32"); return std::make_pair(type, std::make_unique( std::make_unique("IPv4"), std::make_unique(type->getDefaultSerialization()))); }); factory.registerSimpleDataTypeCustom("IPv6", [] { auto type = DataTypeFactory::instance().get("FixedString(16)"); return std::make_pair(type, std::make_unique( std::make_unique("IPv6"), std::make_unique(type->getDefaultSerialization()))); }); /// MySQL, MariaDB factory.registerAlias("INET4", "IPv4", DataTypeFactory::CaseInsensitive); factory.registerAlias("INET6", "IPv6", DataTypeFactory::CaseInsensitive); } }