← 返回首页
gh-77617: Add interactive shell for sqlite3 by erlend-aasland · Pull Request #95026 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-77617: Add interactive shell for sqlite3#95026

Merged
erlend-aasland merged 37 commits into
python:mainfrom
erlend-aasland:sqlite-shell
Aug 1, 2022
Merged

gh-77617: Add interactive shell for sqlite3#95026
erlend-aasland merged 37 commits into
python:mainfrom
erlend-aasland:sqlite-shell

Conversation

erlend-aasland commented Jul 19, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

Disclaimer: this is based off of an old proof-of-concept branch I had lying around. Take it as it is :)

Resolves gh-77617

TODO:

  • docs
  • tests?

Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
erlend-aasland marked this pull request as ready for review July 20, 2022 19:28

Copy link
Copy Markdown
Contributor Author

@rhettinger, would you mind reviewing this?

erlend-aasland marked this pull request as draft July 29, 2022 12:09

Copy link
Copy Markdown
Contributor Author

Putting this PR on hold until the --enable-loadable-sqlite-extensions mess has been fixed in main.

erlend-aasland marked this pull request as ready for review July 29, 2022 19:37
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Erlend Egeberg Aasland and others added 4 commits July 29, 2022 23:22
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
37 hidden items Load more…

Copy link
Copy Markdown
Contributor Author

The python3 -m sqlite3 :memory: "pragma compile_options" trick will be very helpful for triaging and debugging issues.

Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Outdated Show resolved Hide resolved
Comment thread Lib/sqlite3/__main__.py Show resolved Hide resolved

kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

LGTM

Copy link
Copy Markdown
Contributor Author

Added tests; plus some adjustments:

  • return non-zero if SQL passed from the command line fails
  • print exceptions to stderr (not sure if this is a good idea; I have no strong opinion here)

PTAL, @serhiy-storchaka and @kumaraditya303

Comment thread Lib/test/test_sqlite3/test_cli.py Show resolved Hide resolved

serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

👍

Comment thread Lib/test/test_sqlite3/test_cli.py Show resolved Hide resolved
Comment thread Lib/test/test_sqlite3/test_cli.py Outdated Show resolved Hide resolved

Copy link
Copy Markdown
Contributor Author

Thank you for the helpful reviews, Dong-hee, Kumar, and Serhiy. Highly appreciated!

Copy link
Copy Markdown
Contributor Author

FTR, I'm going to land this later today.

erlend-aasland merged commit bc7c7cd into python:main Aug 1, 2022
erlend-aasland deleted the sqlite-shell branch August 1, 2022 10:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stdlib Standard Library Python modules in the Lib/ directory type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an interactive shell for Sqlite3

5 participants

Footer

© 2026 GitHub, Inc.