FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-109151: Enable readline in the sqlite3 CLI by serhiy-storchaka · Pull Request #109152 · python/cpython · GitHub

/ cpython Public

gh-109151: Enable readline in the sqlite3 CLI - #109152

Merged
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:sqlite3-readline
Oct 4, 2023
Merged

gh-109151: Enable readline in the sqlite3 CLI#109152
serhiy-storchaka merged 3 commits into
python:mainfrom
serhiy-storchaka:sqlite3-readline

Conversation

serhiy-storchaka commented Sep 8, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Contributor

Thanks, Serhiy, this is very nice! Ideally, we should have this for 3.12. What do you think? I'm not sure it can be considered a defect/bug.

Copy link
Copy Markdown
Member Author

It is clearly not a bug fix. But it is so much must have feature, that it should go in 3.12.1. Let wait on the release of 3.12.0.

@Yhg1s

Copy link
Copy Markdown
Member

This is a new feature, IMO it's too late for Python 3.12. I dislike when Python behavior changes in 3.x.y bug releases, sorry.

If you want readline in Python 3.12, you can write your CLI code:

#import readline
import sqlite3.__main__
import sys
sqlite3.__main__.main(sys.argv[1:])

vstinner 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

LGTM, just some remarks on the NEWS entry.

…kzkQu.rst

Co-authored-by: Victor Stinner <vstinner@python.org>

Copy link
Copy Markdown
Member

I forgot or didn't know that sqlite3 has a command-line interface. I created issue #109435 to document all stdlib modules which provides a command-line interface (CLI).

Copy link
Copy Markdown
Member Author

The sqlite3 CLI is new in 3.12. This is why I think it is a good idea to backport this change.

I always use utilites that read from the stdin with an external wrapper (rlwrap), but the sqlite3 CLI differs from the dis CLI or others which also can read from the stdin, -- it is intended as a REPL.

Copy link
Copy Markdown
Member

The sqlite3 CLI is new in 3.12. This is why I think it is a good idea to backport this change.

Aha, you can negociate with @Yhg1s. First land it in the main branch :-)

serhiy-storchaka added the needs backport to 3.12 only security fixes label Oct 4, 2023

vstinner 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

LGTM.

serhiy-storchaka merged commit 254e30c into python:main Oct 4, 2023

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 4, 2023
(cherry picked from commit 254e30c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>

bedevere-app Bot commented Oct 4, 2023

Copy link
Copy Markdown

GH-110352 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 4, 2023

Copy link
Copy Markdown
Contributor

Thanks, Serhiy!

vstinner pushed a commit that referenced this pull request Oct 4, 2023
…0352)

gh-109151: Enable readline in the sqlite3 CLI (GH-109152)
(cherry picked from commit 254e30c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Oct 9, 2023
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Oct 9, 2023
Yhg1s pushed a commit that referenced this pull request Oct 9, 2023
Revert "[3.12] gh-109151: Enable readline in the sqlite3 CLI (GH-109152) (#110352)"

This reverts commit bc1fe35.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
serhiy-storchaka deleted the sqlite3-readline branch July 1, 2026 16:51
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL