Skip to content
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

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

Merged
merged 3 commits into from
Oct 4, 2023

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Sep 8, 2023

@erlend-aasland
Copy link
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.

@serhiy-storchaka
Copy link
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

@vstinner
Copy link
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:])

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM, just some remarks on the NEWS entry.

@vstinner
Copy link
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).

@serhiy-storchaka
Copy link
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.

@vstinner
Copy link
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 serhiy-storchaka added the needs backport to 3.12 bug and security fixes label Oct 4, 2023
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@serhiy-storchaka serhiy-storchaka merged commit 254e30c into python:main Oct 4, 2023
19 checks passed
@miss-islington
Copy link
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 <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Oct 4, 2023

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

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Oct 4, 2023
@erlend-aasland
Copy link
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 <[email protected]>
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
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
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