GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-133390: Support SQL keyword completion for sqlite3 CLI by tanloong · Pull Request #133393 · python/cpython Conversation
|
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This needs a whatsnew entry, (maybe a note in the docs?), a NEWS entry and tests.
This is quite limited completion so I guess it could work.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I think we need a separate nodule for this because if we want to have a smarter completion later the code is better to be isolated, so something like sqlite3._completer. If possible, can we have an autogenerated list of keywords? and those keywords could also be stored in a (private) module-level list. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Please add tests |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yes, tests is coming. I will try to find a way to autogenerate list of keywords. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
You can mark the pr as a draft. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
782a599 to
5005d85
Compare
There was an error while loading. Please reload this page.
|
Added tests and moved keyword list to module level. Keywords seems not easy to auto-generate, the SQLite document says they can be accessed by |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
With #133447 in mind the keywords list would be quite handy (I think hardcoding is fine, it doesn't change often anyway). Maybe it could be moved elsewhere, what do you think Benedikt?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
15019ea to
22652ae
Compare
There was an error while loading. Please reload this page.
|
Hi @picnixz, as Stan mentioned, beta freeze is around the corner, but I really hope this can be shipped in 3.14, do you think there is a chance to merge it before beta freeze? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit d681425 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133393%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
sources added which might be available for even old SQLite.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| for (int i = 0; i < count; i++) { | ||
| const char *keyword; | ||
| int size; | ||
| int result = sqlite3_keyword_name(i, &keyword, &size); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
For the record:
We could just assert that the result is SQLITE_OK. This is just an out-of-bounds check, and we know that we are within bounds here. OTOH, we don't know how the SQLite internals may change, so let's keep it like it is.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FTR, CI fails bco. #134077. Let's await a revert or a fix for that. Otherwise, this looks great. Thank you so much for improving the sqlite3 module, @tanloong. Highly appreciated! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
FTR, I've tested this with new SQLite variants, as well as SQLite 3.23.0 and 3.24.0. Everything works as expected for all versions. I should really get to setting up a build-bot with a SQLite library matrix. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I only get the "Display all 147 possibilities? (y or n)" prompt with editline, and never on readline. Probably a bug in readline? Or are we missing a configuration option in order to get this to work? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Readline has a completion-query-items (default value 100) option to determine whether or when this prompt should be shown. https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html#index-completion_002dquery_002ditems With a default readline config the prompt should have be shown, I suspect there is a config that sets the option to 0 on the testing machine? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Nope. I was a little bit vague in my previous comment: I see the text "Display all 147 possibilities? (y or n)", but it is not shown as a prompt after the first tab. It is only displayed together with the resulting completion list, after the second tab. IOW: For editline, I get the prompt on the first tab; for readline, I get no prompt, but I see the prompt text after the second tab. FTR, I already experimented with the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Try |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thank you very much for the careful review and thorough test! There are so many corners and difficulties that I would have never considered let alone solved, thanks for everyone's help! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.