Skip to content

gh-133390: Support SQL keyword completion for sqlite3 CLI #133393

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

Merged
merged 54 commits into from
Jun 6, 2025
Merged
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
1b96be3
Support basic completion for sqlite3 command-line interface
tanloong May 4, 2025
5e50871
Add news entry
tanloong May 4, 2025
c1941cb
Move completion code to separate module
tanloong May 4, 2025
47daca5
Update Lib/sqlite3/_completer.py
tanloong May 4, 2025
c54c2f6
Update Doc/whatsnew/3.14.rst
tanloong May 4, 2025
8fff491
Add test
tanloong May 5, 2025
a766805
Move keyword list to module level
tanloong May 5, 2025
da55014
Remove whatsnew entry from 3.14
tanloong May 5, 2025
ca587e0
Avoid regeneration of candidates. Store them when state is 0 and returns
tanloong May 7, 2025
311b4f3
Add whatsnew entry to 3.15
tanloong May 7, 2025
70f46e9
Address Bénédikt's review
tanloong May 10, 2025
9d03730
Remove color handling of output; If CI fails might need to add back
tanloong May 10, 2025
bfcff38
Fix `run_pty()` doesn't return and test hangs
tanloong May 10, 2025
805d997
Revert "Remove color handling of output; If CI fails might need to ad…
tanloong May 10, 2025
276b4a7
Turn off colored-completion-prefix for readline
tanloong May 10, 2025
09eeac8
No need to pass "NO_COLOR" to `run_pty()`
tanloong May 10, 2025
fc57d71
Flip name
tanloong May 10, 2025
c508069
Triggering completion on Ubuntu requires 2 tabs
tanloong May 10, 2025
231b9e7
Move KEYWORDS to C
tanloong May 10, 2025
121b069
Improve style of C code
tanloong May 10, 2025
90a86cf
Improve tests
tanloong May 11, 2025
5170733
Address Bénédikt's review
tanloong May 16, 2025
b40982a
Revert "Improve style of C code"
tanloong May 16, 2025
226ea9f
Revert "Move KEYWORDS to C"
tanloong May 16, 2025
4eebbd9
Read keyword names dynamically
encukou May 16, 2025
3f9b2c1
Check candidates against KEYWORDS
tanloong May 16, 2025
0410fa2
Use slice to get candidates
tanloong May 16, 2025
bd0b9ce
Address Bénédikt's review
tanloong May 16, 2025
35a17e7
Make candidates tuple
tanloong May 16, 2025
3dd16b3
Revert "Revert "Move KEYWORDS to C""
tanloong May 16, 2025
f3ea951
Revert "Revert "Improve style of C code""
tanloong May 16, 2025
a493ad3
Merge pull request #2 from encukou/sqlite3-cli-completion
tanloong May 16, 2025
34cfc78
Fix 'KEYWORDS' not found
tanloong May 16, 2025
477b48b
Sort keywords before checking the equality
tanloong May 16, 2025
68bb4f3
Fix comparing between tuple and list
tanloong May 16, 2025
4c3b122
Fix comparing between tuple and list
tanloong May 16, 2025
4f1221e
Rename 'test_completion_order' to 'test_completion_for_nothing'
tanloong May 16, 2025
3865131
Don't decrease reference for `PyModule_Add()` and `PyTuple_SetItem()`
tanloong May 25, 2025
8d4f659
Merge branch 'main' into sqlite3-cli-completion
encukou May 29, 2025
ccd98a5
Add @force_not_colorized_test_class
tanloong May 31, 2025
d681425
Merge branch 'main' into sqlite3-cli-completion
encukou Jun 5, 2025
ffd0f02
Add two '\b\b'; Skip tests on FreeBSD
tanloong Jun 5, 2025
6188a6d
Amend skipping reason
tanloong Jun 5, 2025
370dd8b
Remove comment 'set the keyword tuple'
tanloong Jun 5, 2025
16b1674
Disable keyword completion for SQLite<3.24.0
tanloong Jun 5, 2025
ea108ba
Don't disable the whole completion in case there will be more completion
tanloong Jun 5, 2025
13b527e
Use compile-time check
tanloong Jun 5, 2025
fafd1bb
Correct #if usage
tanloong Jun 5, 2025
140818c
Wrap add_keyword_tuple() definition and its call in #if/#endif
tanloong Jun 5, 2025
fd6c89e
Suggestions to python/cpython#133393
erlend-aasland Jun 6, 2025
588fb6a
Merge pull request #3 from erlend-aasland/suggestion
tanloong Jun 6, 2025
5623f16
Merge branch 'main' into sqlite3-cli-completion
erlend-aasland Jun 6, 2025
88c8d59
Update Doc/whatsnew/3.15.rst
erlend-aasland Jun 6, 2025
b3a2b88
Merge branch 'main' into sqlite3-cli-completion
erlend-aasland Jun 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Correct #if usage
  • Loading branch information
tanloong committed Jun 5, 2025
commit fafd1bb2937e53a1a66218c5c480bcd85aef8079
4 changes: 2 additions & 2 deletions Modules/_sqlite/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ pysqlite_error_name(int rc)
static int
add_keyword_tuple(PyObject *module)
{
#if SQLITE_VERSION_NUMBER < 3024000 {
#if SQLITE_VERSION_NUMBER < 3024000
return 0;
}
#endif
int count = sqlite3_keyword_count();
PyObject *keywords = PyTuple_New(count);
if (keywords == NULL) {
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy