| 287 | } |
| 288 | |
| 289 | void DataTypeFactory::registerDataType(const String & family_name, Value creator, Case case_sensitiveness, Documentation documentation) |
| 290 | { |
| 291 | if (creator == nullptr) |
| 292 | throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the data type family {} has been provided a null constructor", family_name); |
| 293 | |
| 294 | String family_name_lowercase = Poco::toLower(family_name); |
| 295 | |
| 296 | if (isAlias(family_name) || isAlias(family_name_lowercase)) |
| 297 | throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the data type family name '{}' is already registered as alias", family_name); |
| 298 | |
| 299 | if (!data_types.emplace(family_name, creator).second) |
| 300 | throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the data type family name '{}' is not unique", |
| 301 | family_name); |
| 302 | |
| 303 | if (case_sensitiveness == Case::Insensitive |
| 304 | && !case_insensitive_data_types.emplace(family_name_lowercase, creator).second) |
| 305 | throw Exception(ErrorCodes::LOGICAL_ERROR, "DataTypeFactory: the case insensitive data type family name '{}' is not unique", family_name); |
| 306 | |
| 307 | data_type_documentations.emplace(family_name, std::move(documentation)); |
| 308 | } |
| 309 | |
| 310 | void DataTypeFactory::registerSimpleDataType(const String & name, SimpleCreator creator, Case case_sensitiveness, Documentation documentation) |
| 311 | { |
no test coverage detected