sqlite3 completion fail on attached names with quotes
未關閉
還沒有人認領這個 Issue。
stdlib
topic-sqlite3
type-bug
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
Tab completion fails in sqlite3 when the name of an attached DB contains a quote.
Minimal code repro:
import sqlite3
from sqlite3._completer import _complete
con = sqlite3.connect(":memory:")
con.execute("""ATTACH ':memory:' AS [has"quote]""")
con.execute("""CREATE TABLE [has"quote].example_table(value)""")
print(_complete(con, "exam", 0)) # sqlite3.OperationalError: unrecognized token: "".sqlite_master
con.close()
Minimal CLI repro if you prefer:
(open the CLI)
>>> <python executable≥ -m sqlite3
(in CLI):
>>> ATTACH ':memory:' AS "has""quote";
>>> CREATE TABLE "has""quote".example_table(value);
>>> SELECT * FROM exam<press tab here and it doesn't work>
CPython versions tested on:
CPython main branch, 3.15
Operating systems tested on:
macOS
Linked PRs
- gh-153770
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 sqlite3._completer._complete 開始,使用 issue 中的 Python 或 CLI 範例,重現附加資料庫名稱包含引號時的失敗。追蹤補全路徑,直到產生的 SQLite 查詢失敗。對於包含引號的附加名稱,Tab 補全能夠成功執行且不出現 unrecognized-token 錯誤,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python, sqlite
- 領域
- cli, database
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100