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

Support multiple DB's #135

Closed
aersam opened this issue Oct 20, 2023 · 4 comments
Closed

Support multiple DB's #135

aersam opened this issue Oct 20, 2023 · 4 comments

Comments

@aersam
Copy link

aersam commented Oct 20, 2023

Hi there

I would like to use sqlite_web to display the gui for multiple db's, which almost works since I can use multiple calls to initialize_app. However, the globals in sqlite_web.py are a deal breaker. Would you accept a PR that simply turns the globals to a dict with the file_name as key or something the like?

@coleifer
Copy link
Owner

No plans for supporting this at the moment.

@aersam
Copy link
Author

aersam commented Oct 20, 2023

Ok, I implemented it myself: https://github.com/bmsuisse/sqlite-web/tree/poetry
However the code has lots of changes:

  • Switched to poetry
  • removed version checks, as I have the versions in poetry now
  • Python 2 support dropped

Just in case you want to have a look at it, feel free to use whatever you want

@coleifer
Copy link
Owner

Does that even work, though? How does the table list look when you're running with multiple databases? Is the database filename/name somehow prefixed into the URL?

@aersam
Copy link
Author

aersam commented Oct 20, 2023

Yes it does! However I need two Flask instances with different prefixes which run under an Azure Function. It works, but is a bit exotic. Using prefixes directly in the routes would be better

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