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

add db.removeDb() #11821

Closed
maloguertin opened this issue May 19, 2022 · 0 comments
Closed

add db.removeDb() #11821

maloguertin opened this issue May 19, 2022 · 0 comments
Labels
new feature This change adds new functionality, like a new method or class
Milestone

Comments

@maloguertin
Copy link

maloguertin commented May 19, 2022

We have a multi tenant architecture where each tenant has it's own DB. At some point we had to manage the connections to the DBs to avoid memory leaks.

This is the clean up function we have:

const handleCleanUp = removedDb => {
    delete db.relatedDbs[removedDb.name]
    db.otherDbs = db.otherDbs.filter(otherDb => removedDb != otherDb)
}

It's not much of a problem but it would be interesting to be able to have an officialy supported way of doing this:

const mOtherDb = db.useDb('my-other-db')
db.removeDb('my-other-db')
@IslandRhythms IslandRhythms added the new feature This change adds new functionality, like a new method or class label May 20, 2022
@vkarpov15 vkarpov15 added this to the 6.x Unprioritized milestone Jun 6, 2022
@vkarpov15 vkarpov15 modified the milestones: 7.x Unprioritized, 7.4.0 Jun 15, 2023
vkarpov15 added a commit that referenced this issue Jul 4, 2023
vkarpov15 added a commit that referenced this issue Jul 10, 2023
feat(connection): add `Connection.prototype.removeDb()` for removing a related connection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This change adds new functionality, like a new method or class
Projects
None yet
Development

No branches or pull requests

3 participants