Skip to content

docs: document 28 of the existing rust community modules #142

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

CommanderStorm
Copy link

@CommanderStorm CommanderStorm commented Jun 11, 2025

there are quite a few rust modules missing.
This PR adds a bunch of them

CC @DDtKey

@CommanderStorm CommanderStorm requested a review from a team as a code owner June 11, 2025 17:01

let postgres_instance = postgres::Postgres::default().start().unwrap();

let connection_string = format!(
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: here in the catalog, we usually just add the container instance declaration, avoiding the addition of more in depth info on how to connect to them. We delegate that to the final docs for each language

Copy link
Author

Choose a reason for hiding this comment

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

fair enough. I just copied the examples from docs.rs ^^

Not quite sure what this means concretely for the modules as noted below 😅

Comment on lines 66 to 71
use testcontainers_modules::{clickhouse, testcontainers::runners::SyncRunner};

let clickhouse = clickhouse::ClickHouse::default().start().unwrap();
let http_port = clickhouse.get_host_port_ipv4(8123).unwrap();

// do something with the started clickhouse instance..
Copy link
Author

@CommanderStorm CommanderStorm Jun 12, 2025

Choose a reason for hiding this comment

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

@mdelapenya so that we sync on what you concretely mean:

Should I remove this part?

Suggested change
use testcontainers_modules::{clickhouse, testcontainers::runners::SyncRunner};
let clickhouse = clickhouse::ClickHouse::default().start().unwrap();
let http_port = clickhouse.get_host_port_ipv4(8123).unwrap();
// do something with the started clickhouse instance..
use testcontainers_modules::{clickhouse, testcontainers::runners::SyncRunner};
let clickhouse = clickhouse::ClickHouse::default().start().unwrap();

or even the imports

Suggested change
use testcontainers_modules::{clickhouse, testcontainers::runners::SyncRunner};
let clickhouse = clickhouse::ClickHouse::default().start().unwrap();
let http_port = clickhouse.get_host_port_ipv4(8123).unwrap();
// do something with the started clickhouse instance..
let clickhouse = clickhouse::ClickHouse::default().start().unwrap();

Copy link
Member

Choose a reason for hiding this comment

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

We are not adding the import in the code snippets, just the var declaration for the container using the module, so I'd go with your second option: is shorter and straight forward, reinforcing the idea that modules are easy to use. Besides, modern IDEs usually autocomplete the imports (Go user here 🙋 😅 ) so it's probably the case in the Rust ecosystem.

Other than that, really appreciate your work adding all these modules to the catalog! The TC Rust community will be very glad for it 🙇

Copy link
Author

Choose a reason for hiding this comment

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

Shure.
In that case, lets also remove the variable assignment.

I would like to keep the originating crate to avoid confusion. Maybe they have a variable named clickhouse if they work with that.

Suggested change
use testcontainers_modules::{clickhouse, testcontainers::runners::SyncRunner};
let clickhouse = clickhouse::ClickHouse::default().start().unwrap();
let http_port = clickhouse.get_host_port_ipv4(8123).unwrap();
// do something with the started clickhouse instance..
testcontainers_modules::clickhouse::ClickHouse::default().start()

The error message they get should explain the rest good enough.

image

maintainer: community
example: |
```rust
use testcontainers_modules::{testcontainers::runners::SyncRunner, mssql_server};
Copy link
Author

Choose a reason for hiding this comment

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

this one needs accepting the eula.. lets keep it ^^

url: https://docs.rs/testcontainers-modules/latest/testcontainers_modules/oracle/free/struct.Oracle.html
maintainer: community
example: |
```rust
Copy link
Author

Choose a reason for hiding this comment

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

lets keep the warning ^^

maintainer: community
example: |
```rust
use testcontainers::core::ImageExt;
Copy link
Author

Choose a reason for hiding this comment

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

since this does not work otherwise, here I am keeping the imports.
It is otherwise a bit confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants