-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Multiple connections with @nestjs/config dependency #684
Comments
@sergiopedrerobenedi What are your base classes? Do Can we start there and see if that fixes it? |
Hi @willsoto , I setted different BaseClass to the different database connections, like you said.
|
Did you correctly register each base class with this module? |
Yes , i did.
And then in the modules
|
Yeah that looks right. I think I have an idea of what is going on here. I don't think registering the same module twice will have any effect. I'll have to add a way to support multiple connections. I can make |
It sounds really nice! |
Published under v3.0.0 |
Documentation: https://github.com/willsoto/nestjs-objection#multiple-connections Please let me know if you have any issues. |
Hello @willsoto ! |
Can you paste a code snippet please? |
Here I have a code error . VS Code says me (relative to name field):
|
Does it compile outside of vscode? It could be that vscode's typings are cached |
Ok, sorry! That was what was happening! |
And @willsoto in the docs section, in the second database connection config, you wrote |
Whoops! Thanks, will fix. |
Hello, |
@cdupetit you would need to provide two different base models, each bound to one of the different connections |
How can I do that ? I have mulitple models defined like this :
|
It's here in the example: https://github.com/willsoto/nestjs-objection#multiple-connections
|
Yes but I have mulitple tables (models) in the database. |
|
Thanks. I will try the binding pattern. |
Hi @willsoto.
Your module is really awesome!
But i have this problem:
I don't know how to implement multiple database connections with your module.
I need to use NestJS ConfigService for two database connections like this:
But when i make queries through each model, always works with first database configuration.
Could you help me?
Thanks!
The text was updated successfully, but these errors were encountered: