| 61 | } |
| 62 | |
| 63 | void buildConnectionString( |
| 64 | std::string_view host_and_port, |
| 65 | std::string_view right_part, |
| 66 | Poco::URI & uri, |
| 67 | std::vector<std::vector<std::string>> & hosts_and_ports_arguments) |
| 68 | { |
| 69 | // User info does not matter in sub URI |
| 70 | auto uri_string = std::string(CONNECTION_URI_SCHEME); |
| 71 | if (!host_and_port.empty()) |
| 72 | { |
| 73 | uri_string.append("//"); |
| 74 | uri_string.append(host_and_port); |
| 75 | } |
| 76 | |
| 77 | // Right part from string includes '/database?[params]' |
| 78 | uri_string.append(right_part); |
| 79 | try |
| 80 | { |
| 81 | uri = Poco::URI(uri_string); |
| 82 | } |
| 83 | catch (const Poco::URISyntaxException & invalid_uri_exception) |
| 84 | { |
| 85 | throw DB::Exception(DB::ErrorCodes::BAD_ARGUMENTS, |
| 86 | "Invalid connection string syntax {}: {}", uri_string, invalid_uri_exception.what()); |
| 87 | } |
| 88 | |
| 89 | getHostAndPort(uri, hosts_and_ports_arguments); |
| 90 | } |
| 91 | |
| 92 | std::string makeArgument(const std::string & connection_string_parameter_name) |
| 93 | { |
no test coverage detected