MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / formatConnectionString

Function formatConnectionString

src/Core/PostgreSQL/Utils.cpp:11–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9{
10
11ConnectionInfo formatConnectionString(String dbname, String host, UInt16 port, String user, String password, UInt64 timeout)
12{
13 DB::WriteBufferFromOwnString out;
14 out << "dbname=" << DB::quote << dbname
15 << " host=" << DB::quote << host
16 << " port=" << port
17 << " user=" << DB::quote << user
18 << " password=" << DB::quote << password
19 << " connect_timeout=" << timeout;
20 return {out.str(), host + ':' + DB::toString(port)};
21}
22
23String getConnectionForLog(const String & host, UInt16 port)
24{

Calls 2

toStringFunction · 0.50
strMethod · 0.45

Tested by

no test coverage detected