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

[Enhancement]: Allow Oracle container builder to set the database name #1233

Open
sebastienros opened this issue Aug 13, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@sebastienros
Copy link

Problem

The currently used Oracle image uses a database named XEPDB1. In the more recent versions of the image it is named FREEPDB1. The current API allows us to change the image to use with Oracle but doesn't permit to change the database name:

  • WithDatabase(string) exists but is private
  • Merge(configuration) exists but is protected and the class sealed

As a consequence there is no way to pick a newer version of this image, potentially with better security.

Solution

Make WithDatabase public

Benefit

Not having to request the image to be changed in TestContainers.

Alternatives

N/A

Would you like to help contributing this enhancement?

Yes

@sebastienros sebastienros added the enhancement New feature or request label Aug 13, 2024
@HofmeisterAn
Copy link
Collaborator

I believe the method is private because previous versions did not support changing the database name, but it seems this is supported in version 18c and later (see ORACLE_DATABASE). We need to update the builder's logic accordingly. In the meantime, you can either use the generic builder or set the environment variable and use your own connection string as a workaround for this limitation (maybe we need to adjust the wait strategy too).

@0xced
Copy link
Contributor

0xced commented Aug 14, 2024

I was working on this a few days ago. Pull request #1231 did not come out of the blue, it was a prerequisite to select the correct default database name (XE, XEPDB1 or FREEPDB1) based on the Docker image version. 😉

I have a branch that support all Oracle versions: https://github.com/0xced/testcontainers-dotnet/tree/feature/oracle-all-versions
Currently it's stacked on #1165 because it was easier to write all the tests with the new Testcontainers.Xunit package.

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

No branches or pull requests

3 participants