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

Question: Is there a way to support multiple databases with single connection? #172

Open
AhmedMasoodSiddiqui opened this issue Aug 21, 2019 · 1 comment

Comments

@AhmedMasoodSiddiqui
Copy link

Is there a way to connect to multiple databases using a single or multiple connection? typeorm docs suggests there is and it works with simple node project, but i cant configure it in this project.
I have changed the single connection from typeormLoader.ts to array.

@carlosHowmie
Copy link

According to TypeORM docs, you can either use multiple connections by passing an array to the createConnection method, or in case you want to work with just one connection check:

https://typeorm.io/#/multiple-connections/using-multiple-databases-in-a-single-connection

You'll have to specify which database you want to connect and work with in your entities, and very likely in some other places as you keep adding business logic into your Services and Repositories.

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

No branches or pull requests

2 participants