-
-
Notifications
You must be signed in to change notification settings - Fork 297
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
Make ESDB container implement IDatabaseContainer #1053
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interface represents a database container instance that can be accessed with an ADO.NET provider. Does ESDB support ADO.NET? We test against the db client.
I already figured it out by looking at failing test, and I am not exactly following that decision. The interface doesn't suggest anything like that, so it's unclear from the API surface what is the intention behind that interface. From the test perspective, and looking at other container implementations, it looks like MonoDB for example, is not a database when we all know it definitely is a database. Or Neo4j, or ESDB in that regard. I personally find it confusing. |
Indeed, the interface itself does not, but the description does. IIRC, the initial idea was
No one is saying that MongoDB or ESDB are not databases, but abstraction becomes significant when commonality exists. You cannot easily swap MongoDB with ESDB as you can with ADO.NET compatible containers (AFAIK). But it is definitely ambiguous. Such as the publicly available methods to retrieve the connection string, endpoint, base address, etc. Typically, I aim to correspond to the client library.
Could you provide more details about what you are trying to abstract? I would like to get a better understanding of the use cases. |
I have a base class that is used across different implementation, which are database-specific. In my case, the abstraction is on a high enough level to just need the I ended up making the base class generic, where the generic parameter is constrained to |
Maybe we can add support together with this issue. Right now, I am considering a connection string provider or something similar, which is capable of resolving the correct connection strings. This would allow developers to override the default connection string and could be used for the abstraction too. |
As mentioned, the interface is exclusively for ADO.NET compatible containers. I've generated a follow-up issue that includes a proposal for implementing a connection string provider across all modules. I'll close this PR. Let's carry on the discussion in the referenced issue. Thank you for bringing this to my attention. |
What does this PR do?
EvebtStoreDbContainer
class implements theGetConnectionString
method so it can inherit fromIDatabaseContainer
.Why is it important?
When creating an abstraction for tests, I can't currently use
IDatabaseContainer
and itsGetConnectionString
becauseEventStoreDbContainer
doesn't implement the interface.