You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sqlite3 CLI completer: include views in column completion #158277
_complete() in Lib/sqlite3/_completer.py restricts column-name
completion to entries in sqlite_master with type='table'. Views
(type='view') are excluded, even though pragma_table_xinfo returns
their columns. The comment above the block already states the intent to
cover views:
# tables, indexes, triggers, and views
Reproducer:
importsqlite3fromsqlite3._completerimport_completecon=sqlite3.connect(":memory:")
con.execute("CREATE TABLE t (a INTEGER, b INTEGER)")
con.execute("CREATE VIEW v AS SELECT a, b, a + b AS sum_ab FROM t")
print(_complete(con, "sum", 0)) # 'SUM('print(_complete(con, "sum", 1)) # Nonecon.close()
Expected: _complete(con, "sum", 1) returns 'sum_ab ' (the view column).
Actual: only 'SUM(' is returned.
Activity
StanFromIreland commentedon Sep 27, 2026
CC @tanloong