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
No easy way to switch between database connections #1634
Comments
Example test script would look like ...
|
Stringises a cleanup action so that it appears better on console. Also fixes a typo namespace error.
Please can one of you experienced souls review this issue/feature request and the PR |
Would be very helpful. Thanks for report @codemedic! |
+1! I need this feature! I work in a big project with a one database for each client. I need to change the connection to connect this DB's. |
+1 |
I have kicked off an extension https://github.com/natterbox/Codeception-MultiDb |
+1 |
1 similar comment
+1 |
@gilbitron and @kpascal |
👍 |
1 similar comment
+1 |
Nice Idea |
I haven't done a deep review on @codemedic code, but seems ok. |
I use sqlite connection and switch with _reconfigure on a helper...so i can also read db settings from .env file |
its great that we all use this and this but how about a working copy example so others can be successful with "this and this" configurations |
We do not have all the same settings because everybody has a special usecase |
@raistlin Please can you point me in the right direction. Ta |
|
You should create a PR against Codeception web https://github.com/Codeception/codeception.github.com |
As discussed on Codeception/Codeception#1634. Adding brief description of Red Matter's MultiDb module which is available on packagist.org as `redmatter/codeception-multidb`.
Db module has this functionality since 2.5.0 https://codeception.com/docs/modules/Db#Example-with-multi-databases |
When working with multiple databases, it seems not possible to switch between database connections (DSNs).
A typical use case would be in situations where you have two databases which are differently tuned; for the kind of data they deal with. One for configuration lookup, i.e high performance, almost all coming from memory, and the other database server for huge tables, say for example logs or financial transaction history.
If one needs to write a test that would talk to multiple databases, it would be handy to be able to switch between DSNs at will during the test.
The text was updated successfully, but these errors were encountered: