Closed alexanderomnix closed 4 years ago
This issue has been discussed many times in the past. TypeOrmModule
won't be a good fit for your case. Please, follow this chapter https://docs.nestjs.com/recipes/sql-typeorm
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.
[ ] Regression [x] Bug report [ ] Feature request [x] Documentation issue or request [ ] Support request
Current behavior
I have multiple databases to connect using Nestjs and Typeorm but I wanted my application to started even if the database is unavailable, but I cannot have a workaround how to do it using this module, even after read a lot of issues and the full documentation, how to silence the nestjs Errors and start my application. Even if the database that I imported at any module level is unavailable the connection still crash the whole stack.
Expected behavior
Application bootstrap even if database is unavailable, and serve modules that do not depend on that connection.
Minimal reproduction of the problem with instructions
Start a simple nestjs project and import the database using TypeOrmModule and the forRoot Method, turn off the database and start the app, the connection breaks the whole application even modules that do not need that connection.
What is the motivation / use case for changing the behavior?
sometimes an application needs to talk to multiple databases that can be on and off, if the connection is unsuccessful I need my app to still on because another modules do not depend on that connection to work.
Environment