coleifer / sqlite-web

Web-based SQLite database browser written in Python
MIT License
3.43k stars 339 forks source link

Support multiple DB's #135

Closed aersam closed 1 year ago

aersam commented 1 year ago

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 commented 1 year ago

No plans for supporting this at the moment.

aersam commented 1 year ago

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

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

coleifer commented 1 year ago

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 commented 1 year ago

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