MultiDatabase .save() Problem
See original GitHub issue
[ ] Regression
[*] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Connection config charactersConnection
TypeOrmModule.forRoot app.module.ts
TypeOrmModule.forFeature characters.module.ts
@InjectRepository characters service
work fine with query builder getConnection
but i get error when use .save()
Error: No repository for "CharacterBanned" was found. Looks like this entity is not registered in current "default" connection?
i dont need default connection for that.
Expected behavior
I want use .save() without default connection. .save()
Environment
Nest version: 6.9.0
For Tooling issues:
- Node version: 12.13.0
- Platform: Linux
Others:
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Django model form save (multi database) question
The first example does not work - it doesn't update the instance from the form. Use the second.
Read more >Multiple databases | Django documentation
See Multi-database support for information about testing with multiple databases. ... Use the using keyword to Model.save() to specify to which database the ......
Read more >saving multiple students in database at once but problem is it ...
i'm filling students data in database and i want to take the input data of more than one student at the once and...
Read more >How to Configure Multiple Data Sources in a Spring Boot ...
public DataSource memberDataSource() { ... cardRepository.save() fails (e.g. because of a connection issue) and the _cardTransactionManager_ ...
Read more >Using Multiple Databases in ASP.NET Core via Entity ...
public void Save() => _repositoryContext. ... We can see that our project works with multiple databases without a single problem.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You’d need to specify you’re using the connection named
chat
so you can use theChat
entity from./entitydb2
. The minimum reproduction looks related to TypeORM and not to Nest directly. Please look at their repository or slack channel for help.For posterity’s sake, I found an answer here: https://github.com/typeorm/typeorm/issues/3205
Which is to do: