GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-77617: Add interactive shell for sqlite3 by erlend-aasland · Pull Request #95026 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Jul 19, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JakobDev and serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
Erlend E. Aasland @erlend-aasland
Add proof-of-concept REPL
def2e81
@bedevere-bot bedevere-bot added the awaiting core review label Jul 19, 2022
@erlend-aasland erlend-aasland mentioned this pull request Jul 19, 2022
Add an interactive shell for Sqlite3 #77617
Closed
erlend-aasland
erlend-aasland commented Jul 19, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Add NEWS
1f01905
@erlend-aasland
erlend-aasland requested review from rhettinger and serhiy-storchaka July 19, 2022 22:24
erlend-aasland
erlend-aasland commented Jul 19, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland added 3 commits July 20, 2022 17:25
@erlend-aasland
Remove redundant __name__ condition
86a4566
@erlend-aasland
Merge branch 'main' into sqlite-shell
d04b6f3
@erlend-aasland
Add -v argument for dumping SQLite version
896834c
corona10
corona10 reviewed Jul 20, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Address review: close connection explicitly
4ba731a
@erlend-aasland
erlend-aasland marked this pull request as ready for review July 20, 2022 19:28
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner July 20, 2022 19:28
erlend-aasland added 4 commits July 29, 2022 12:00
@erlend-aasland
Merge branch 'main' into sqlite-shell
814cced
@erlend-aasland
Add docs
8179a68
@erlend-aasland
Remove copyright, credits, and license cli commands
91a77b7
@erlend-aasland
Document how to quit
2f27a04
@erlend-aasland

erlend-aasland commented Jul 29, 2022

Copy link
Copy Markdown
Contributor Author

@rhettinger, would you mind reviewing this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Fix sphinx option refs by moving the footnote up to where it belongs,…
ae55e8e
… and making it a note
@erlend-aasland
erlend-aasland marked this pull request as draft July 29, 2022 12:09
@erlend-aasland

erlend-aasland commented Jul 29, 2022

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Merge branch 'main' into sqlite-shell
91e1ec9
@erlend-aasland
erlend-aasland marked this pull request as ready for review July 29, 2022 19:37
serhiy-storchaka
serhiy-storchaka reviewed Jul 29, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend Egeberg Aasland and others added 4 commits July 29, 2022 23:22
Erlend Egeberg Aasland @serhiy-storchaka
Address review: iterate over cursor
024cd90
Co-authored-by: Serhiy Storchaka <[email protected]>
Erlend Egeberg Aasland @serhiy-storchaka
Address review: repr iso. f-string
dee441a
Co-authored-by: Serhiy Storchaka <[email protected]>
@erlend-aasland
Address review: pass connection iso. path
ec04ea3
@erlend-aasland
Address review: use argparse version trick
9b79230
@erlend-aasland

erlend-aasland commented Jul 31, 2022

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303
kumaraditya303 reviewed Jul 31, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303
kumaraditya303 reviewed Jul 31, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303
kumaraditya303 reviewed Jul 31, 2022
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

kumaraditya303
kumaraditya303 approved these changes Jul 31, 2022
View reviewed changes

@kumaraditya303 kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
erlend-aasland added 8 commits July 31, 2022 12:05
@erlend-aasland
Partially address Kumar's review: use narrow exception
82c753c
@erlend-aasland
Partially address more of Kumar's review: add guard
36454ab
@erlend-aasland
Use pattern matching
625e2e3
@erlend-aasland
Revert "Partially address more of Kumar's review: add guard"
f624873
This reverts commit 36454ab.
@erlend-aasland
Print errors to stderr iso. stdout
df75f5f
@erlend-aasland
Non-zero exit for SQL errors passed from command line
44c2571
@erlend-aasland
Add tests
d640458
@erlend-aasland
Simplify interactive tests
0997004
@erlend-aasland

erlend-aasland commented Jul 31, 2022

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland
erlend-aasland commented Jul 31, 2022
View reviewed changes
Comment thread Lib/test/test_sqlite3/test_cli.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland added 2 commits August 1, 2022 00:28
@erlend-aasland
Use -Xutf8
7ba91e7
@erlend-aasland
Fix argument order
b74e010
@erlend-aasland
erlend-aasland requested review from kumaraditya303 and serhiy-storchaka July 31, 2022 23:17
serhiy-storchaka
serhiy-storchaka approved these changes Aug 1, 2022
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

👍

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with hooray emoji
All reactions
  • 🎉 1 reaction
Comment thread Lib/test/test_sqlite3/test_cli.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/test/test_sqlite3/test_cli.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Aug 1, 2022
@erlend-aasland
Address review: move cleanups up
903b867
@erlend-aasland

erlend-aasland commented Aug 1, 2022

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
Last adjustment: inline runsql()
796ba16
@erlend-aasland

erlend-aasland commented Aug 1, 2022

Copy link
Copy Markdown
Contributor Author

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

stonebig reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland merged commit bc7c7cd into python:main Aug 1, 2022
@bedevere-bot bedevere-bot removed the awaiting merge label Aug 1, 2022
@erlend-aasland
erlend-aasland deleted the sqlite-shell branch August 1, 2022 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@corona10 corona10 corona10 left review comments
@serhiy-storchaka serhiy-storchaka serhiy-storchaka approved these changes
@rhettinger rhettinger Awaiting requested review from rhettinger
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
@kumaraditya303 kumaraditya303 Awaiting requested review from kumaraditya303

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add an interactive shell for Sqlite3

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@erlend-aasland @serhiy-storchaka @corona10 @kumaraditya303 @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.