Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection options for MongoDB dictionaries #49225

Merged
merged 8 commits into from Apr 29, 2023

Conversation

MikhailBurdukov
Copy link
Contributor

@MikhailBurdukov MikhailBurdukov commented Apr 26, 2023

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Enable connection options for the MongoDB dictionary.
Example:

<source>
    <mongodb>
        <host>localhost</host>
        <port>27017</port>
        <user></user>
        <password></password>
        <db>test</db>
        <collection>dictionary_source</collection>
        <options>ssl=true</options>
    </mongodb>
</source>

Documentation entry for user-facing changes

  • Add an optional parameter to MongoDB dictionary to accept connection string options and support SSL connection.

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

@robot-ch-test-poll robot-ch-test-poll added the pr-improvement Pull request with some product improvements label Apr 26, 2023
@MikhailBurdukov MikhailBurdukov changed the title Mongo dict tls Connection options for MongoDB dictionaries Apr 26, 2023
@kssenii kssenii self-assigned this Apr 26, 2023
@kssenii kssenii added the can be tested Allows running workflows for external contributors label Apr 26, 2023
// Connect with host/port/user/etc.
connection->connect(host, port);
// Connect with host/port/user/etc through constructing
std::string uri_constructed("mongodb://" + host + ":" + std::to_string(port) + "/" + db + "?" + options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::string uri_constructed("mongodb://" + host + ":" + std::to_string(port) + "/" + db + "?" + options);
std::string uri_constructed("mongodb://" + host + ":" + std::to_string(port) + "/" + db + (options.empty() ? "" : "?" + options));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in commit.

@kssenii
Copy link
Member

kssenii commented Apr 29, 2023

Stateless tests (debug, s3 storage) [6/6] — Tests are not finished

#49185

Integration tests (release) [2/4]

test_merge_tree_s3/test.py::test_store_cleanup_disk_s3 - not related to changes

@kssenii kssenii merged commit 7d867d7 into ClickHouse:master Apr 29, 2023
266 of 269 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can be tested Allows running workflows for external contributors pr-improvement Pull request with some product improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants