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

Dynamic DB connections #455

Open
sdether opened this issue Aug 21, 2021 · 3 comments
Open

Dynamic DB connections #455

sdether opened this issue Aug 21, 2021 · 3 comments

Comments

@sdether
Copy link

sdether commented Aug 21, 2021

My use case requires dynamic database connections to databases not managed by django. These databases are created on on demand, so i can't enumerate them in settings.

I know this scenario likely falls outside the scope of django-sql-explorer, but maybe there is a way to override get_valid_connection() that I haven't thought of, so that I can populate the connection information on lookup miss.

@marksweb
Copy link
Collaborator

Hi @sdether

So you're looking for the ability to query arbitrary databases outside the scope of Django itself?

@sdether
Copy link
Author

sdether commented Aug 21, 2021

Correct. We have our django database for the application, but we generate customer specific warehouse databases via some ETL processes dynamically and django-sql-explorer would be an ideal tool to let customers explore these databases. From my reading of the code get_valid_connection() is the proxy for fetching connections from django allowed for the explorer.

If there is a hook to override its behavior, I could populate the connection information on lookup miss of alias. If there isn't a hook, I could prepare a PR to provide one, unless this goes counter to the mission of this project.

@marksweb
Copy link
Collaborator

@sdether I'm all for extending features/functionality, so a PR to make this an option would be good 👍

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

No branches or pull requests

3 participants