MCPcopy Create free account
hub / github.com/apache/cloudberry / conninfo_uri_parse

Function conninfo_uri_parse

src/interfaces/libpq/fe-connect.c:6141–6171  ·  view source on GitHub ↗

* Subroutine for parse_connection_string * * Deal with a URI connection string. */

Source from the content-addressed store, hash-verified

6139 * Deal with a URI connection string.
6140 */
6141static PQconninfoOption *
6142conninfo_uri_parse(const char *uri, PQExpBuffer errorMessage,
6143 bool use_defaults)
6144{
6145 PQconninfoOption *options;
6146
6147 /* Make a working copy of PQconninfoOptions */
6148 options = conninfo_init(errorMessage);
6149 if (options == NULL)
6150 return NULL;
6151
6152 if (!conninfo_uri_parse_options(options, uri, errorMessage))
6153 {
6154 PQconninfoFree(options);
6155 return NULL;
6156 }
6157
6158 /*
6159 * Add in defaults if the caller wants that.
6160 */
6161 if (use_defaults)
6162 {
6163 if (!conninfo_add_defaults(options, errorMessage))
6164 {
6165 PQconninfoFree(options);
6166 return NULL;
6167 }
6168 }
6169
6170 return options;
6171}
6172
6173/*
6174 * conninfo_uri_parse_options

Callers 1

parse_connection_stringFunction · 0.85

Calls 4

conninfo_initFunction · 0.85
PQconninfoFreeFunction · 0.85
conninfo_add_defaultsFunction · 0.85

Tested by

no test coverage detected