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 an interactive shell for Sqlite3 #77617
Comments
To facilitate rapid experimentation with SQL queries, add a shell to run commands and display results. Attached is minimal proof-of-concept modeled loosely on the Linux sqlite3 REPL. Here's a sample session:
|
It's not immediately obvious what benefits this provides over the existing sqlite-native repl and the python repl. Can you expand a bit on the use case? Also, I seem to remember that Catherine Devlin had at one point thought about expanding her sqlpython to be multi-db capable, and while it doesn't look like that has happened, maybe that would be an alternative worth investigating? (I've never used it or looked at its code, so it may not be.) |
It could be added in Tools/scripts directory or as a part of the sqlite3 module.
The existing sqlite-native repl is not always installed when Python is installed (especially on Windows). It is handy that Python provides CLI to some modules, including zipfile and tarfile. I would prefer CLI, but maybe both interfaces can be combined. It would be nice to provide also a graphical Sqlite3 browser, which can be ran as a separate application and be integrated with IDLE (as turtledemo). |
as a graphical sqlite browser, you have sqlite_bro that may give you inspiration. It's about one single file. |
I think this is a good idea. Proof-of-concept implementation added (invoke REPL with Possible improvements:
- Use sqlite3.complete_statement()
- Support Python syntax as well. For example:
>>> select * from t
>>> res = _
>>> print(res[0]) |
Do we still want to do this? See https://discuss.python.org/t/titling-sqlite3-table-columns-with-number/13656/3. |
@rhettinger, @serhiy-storchaka, are you still +1 on this? I'm +1, because...
|
I am +1 on this for the same reasons. Go ahead, it would be fun. |
I am +1, this would make Windows sqlite users happy. |
I'll revive my patch. |
Rebased and cleaned up slightly. Draft PR up: #95026 IMO, let's just provide a dead simple sqlite3 shell for now; if more features are needed, let's add those in separate issues. |
Possible future enhancements:
|
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Thanks Raymond, for the pitch. Thanks Dong-hee, Kumar, and Serhiy for helpful reviews. This has now been implemented by #95026. Enhancement requests go as separate issues. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: