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 — Support completion for sqlite3 command-line interface · Issue #133390 · python/cpython

Support completion for sqlite3 command-line interface #133390

New issue
Copy link
New issue
Copy link
Closed
Closed
Support completion for sqlite3 command-line interface#133390
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-sqlite3type-featureA feature request or enhancementA feature request or enhancement

Description

@tanloong
tanloong
opened on May 4, 2025
Issue body actions

Feature or enhancement

Proposal:

Current sqlite3 CLI lacks tab-completion feature. Hope it can be supported to improve usability.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

  • gh-133390: Support SQL keyword completion for sqlite3 CLI #133393
  • Revert "gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)" temporarily #135232
  • gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393) #135292
  • gh-133390: Extend completion for .commands in sqlite3 #135432
  • gh-133390: Document SQLITE_KEYWORDS #135659
  • gh-133390: Support table, index, trigger, view, column, function, and schema completion in the sqlite3 CLI #136101
  • gh-133390: Amend gh-135659 (sqlite3 docs update) #137447

Activity

Next
  1. tanloong
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on May 4, 2025
  2. hugovk
    added
    topic-sqlite3
    on May 4, 2025
  3. StanFromIreland commented on May 4, 2025

    @StanFromIreland
    StanFromIreland
    on May 4, 2025
    Member
    More actions

    This is a minor feature

    I would disagree, this would presumably require quite a lot of work to implement and then maintain. Maybe this should be discussion on discourse first?

  4. tanloong commented on May 4, 2025

    @tanloong
    tanloong
    on May 4, 2025
    ContributorAuthor
    More actions

    Right. But I think for the moment we can support basic completion which takes not much work but gives big experience enhancement.

  5. picnixz
    added
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    and removed
    extension-modulesC modules in the Modules dirC modules in the Modules dir
    on May 4, 2025
  6. StanFromIreland commented on May 4, 2025

    @StanFromIreland
    StanFromIreland
    on May 4, 2025
    Member
    More actions

    #133393 introduces keyword expansion, but what about name expansion (the part I was originally worried about)?

  7. tanloong commented on May 4, 2025

    @tanloong
    tanloong
    on May 4, 2025
    ContributorAuthor
    More actions

    Can we get the name list when connecting to a disk-file database, merge it with keyword list as completion candidates? Also the name list need to be updated on deletion/creation of table/column.

    import sqlite3
    
    def get_names(db_path):
        ret = []
        conn = sqlite3.connect(db_path)
        cursor = conn.cursor()
    
        cursor.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;")
        tables = [row[0] for row in cursor.fetchall()] # get table names
        ret.extend(tables)
    
        for table in tables:
            cursor.execute(f"PRAGMA table_info({table})")
            ret.extend(row[1] for row in cursor.fetchall()) # get column names
    
        conn.close()
        return ret
    
    db_path = '/path/to/db.db'
    list_of_names = get_names(db_path)
  8. StanFromIreland commented on May 5, 2025

    @StanFromIreland
    StanFromIreland
    on May 5, 2025
    Member
    More actions

    @hugovk (BDFC ;-) out of curiosity, is this on your list for colorising, it is a good candidate ? I’d take a stab at it once this is merged.

  9. hugovk commented on May 5, 2025

    @hugovk
    hugovk
    on May 5, 2025
    Member
    More actions

    It's not on my list but sounds like a good candidate. See also #133247 that added syntax highlighting in the REPL and tools like https://github.com/dbcli/litecli.

    Reacted by Stan Ulbrych
  10. StanFromIreland commented on May 5, 2025

    @StanFromIreland
    StanFromIreland
    on May 5, 2025
    Member
    More actions

    sounds like a good candidate.

    Opened #133447 :-)

    Reacted by Hugo van Kemenade
  11. erlend-aasland
    added a commit that references this issue on Jun 6, 2025

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

    62b3d2d
  12. encukou commented on Jun 7, 2025

    @encukou
    encukou
    on Jun 7, 2025
    Member
    More actions

    Unfortunately, there are issues on the buildbots found before, e.g. here.

    I spent some time investigating this, but couldn't reproduce locally or in a container. Next week I'll ask the buildbot owner for SSH access to try and see what's going on, but that's better done after the weekend.

    The buildbots are only effective if they're kept passing, so I need to revert the commit temporarily.

  13. encukou
    added a commit that references this issue on Jun 7, 2025

    Revert "pythongh-133390: Support SQL keyword completion for sqlite3 C…

    e8f8de1
  14. 24 remaining items

  15. taegyunkim
    added a commit that references this issue on Aug 4, 2025

    pythongh-133390: Document `SQLITE_KEYWORDS` (pythonGH-135659)

    6d1115e
  16. erlend-aasland
    added 2 commits that reference this issue on Aug 6, 2025

    pythongh-133390: Amend pythongh-135659 (sqlite3 docs update)

    b322fb2

    gh-133390: Amend gh-135659 (sqlite3 docs update) (#137447)

    247dab2
  17. Agent-Hellboy
    added 5 commits that reference this issue on Aug 19, 2025

    pythongh-133390: Support SQL keyword completion for sqlite3 CLI (pyth…

    6c858a7

    Revert "pythongh-133390: Support SQL keyword completion for sqlite3 C…

    b10de71

    pythongh-133390: Support SQL keyword completion for sqlite3 CLI (pyth…

    c2661a6

    pythongh-133390: Document `SQLITE_KEYWORDS` (pythonGH-135659)

    cc42459

    pythongh-133390: Amend pythongh-135659 (sqlite3 docs update) (python#…

    af72285
  18. encukou
    added a commit that references this issue on Aug 25, 2025

    gh-133390: Extend completion for .commands in `sqlite3` (GH-135432)

    a553065
  19. encukou
    added a commit that references this issue on Oct 24, 2025

    gh-133390: sqlite3 CLI completion for tables, columns, indices, trigg…

    161b306
  20. encukou commented on Oct 24, 2025

    @encukou
    encukou
    on Oct 24, 2025
    Member
    More actions

    Thank you for the completion, @tanloong!

    Do you plan to add more, or should we close the issue?

  21. tanloong commented on Oct 24, 2025

    @tanloong
    tanloong
    on Oct 24, 2025
    ContributorAuthor
    More actions

    Thanks a lot to everyone for all the help and review!

    There is no more I plan to add. I will close this issue.

    Reacted by Petr Viktorin
  22. tanloong
    closed this as completedon Oct 24, 2025
  23. StanFromIreland commented on Oct 24, 2025

    @StanFromIreland
    StanFromIreland
    on Oct 24, 2025
    Member
    More actions

    Developer thought completion? ;-)

    Thanks for all of your work in this!

  24. StanFromIreland
    added a commit that references this issue on Dec 6, 2025

    pythongh-133390: sqlite3 CLI completion for tables, columns, indices,…

    11cf374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-sqlite3type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.