coleifer / sqlite-web

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

Support multiple DB's #135

Closed aersam closed 11 months ago

aersam commented 11 months 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 11 months ago

No plans for supporting this at the moment.

aersam commented 11 months 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 11 months 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 11 months 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