* Connection string parser * * Returns a malloc'd PQconninfoOption array, if parsing is successful. * Otherwise, NULL is returned and an error message is added to errorMessage. * * If use_defaults is true, default values are filled in (from a service file, * environment variables, etc). */
| 5638 | * environment variables, etc). |
| 5639 | */ |
| 5640 | static PQconninfoOption * |
| 5641 | parse_connection_string(const char *connstr, PQExpBuffer errorMessage, |
| 5642 | bool use_defaults) |
| 5643 | { |
| 5644 | /* Parse as URI if connection string matches URI prefix */ |
| 5645 | if (uri_prefix_length(connstr) != 0) |
| 5646 | return conninfo_uri_parse(connstr, errorMessage, use_defaults); |
| 5647 | |
| 5648 | /* Parse as default otherwise */ |
| 5649 | return conninfo_parse(connstr, errorMessage, use_defaults); |
| 5650 | } |
| 5651 | |
| 5652 | /* |
| 5653 | * Checks if connection string starts with either of the valid URI prefix |
no test coverage detected