enable_fts() exhausts iterator columns before populating the index
メンテナーはふだん 3 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 83/100
調査の方向性
トリガーの構築を含め、Table.enable_fts() と populate_fts() の実装を読み、その後、インメモリデータベースで issue の再現手順を実行してください。columns イテラブルが、FTS テーブルの作成とデータ投入、およびトリガーの構築にどのように使われるかを確認してください。FTS4 と FTS5 の両方で、トリガーの有無にかかわらず一度しか反復できないイテレーターが機能し、リスト入力も引き続き機能すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
Table.enable_fts() accepts columns: Iterable[str], but passing a one-shot iterator raises sqlite3.OperationalError: near ")": syntax error. The same columns supplied as a list work. The FTS virtual table has already been created when the error occurs, so a retry without replace=True also encounters an existing table.
Reproduced locally against main 9c66bafa52ae23d40499c74b0db3b635bcddb876, Python 3.12.14, using an in-memory database:
from sqlite_utils import Database
db = Database(memory=True)
table = db["notes"].insert({"text": "hello"})
table.enable_fts(iter(["text"]))
# sqlite3.OperationalError: near ")": syntax error
Replacing iter(["text"]) with ["text"] succeeds and list(table.search("hello")) returns the record. I reproduced the failure with both FTS4 and FTS5, with and without create_triggers=True.
The iterable is consumed while building CREATE VIRTUAL TABLE, then passed to populate_fts(). Trigger construction also reuses it. Materializing the columns once would preserve the declared iterable contract.
AI assistance: OpenAI Codex inspected the code and ran this reproduction. No live service, user database, or external model call was used.
- 主要言語
- Python
- スター
- 2.2k
- フォーク
- 215
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
simonw/sqlite-utils のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
simonw/sqlite-utils#928 ·
メンテナーはふだん 3 日以内に返信
-
Tests use CliRunner.isolated_filesystem(), which is deprecated and will be removed in Click 9.0対応中かも @devpryan7792 が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
simonw/sqlite-utils#916 ·
メンテナーはふだん 3 日以内に返信
-
rows_from_file() splits a single-column CSV file on a letter, or raises csv.Error対応中かも @L4XB が 19 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
simonw/sqlite-utils#907 ·
メンテナーはふだん 3 日以内に返信
-
rows_from_file() ignores ignore_extras= and extras_key= for anything that isn't Format.CSV対応中かも @feiiiiii5 が 37 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
simonw/sqlite-utils#892 ·
メンテナーはふだん 3 日以内に返信
-
Raw numpy scalar values get silently stored as corrupted BLOBs instead of being converted対応中かも @TanbirRamim が 43 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
simonw/sqlite-utils#876 ·
メンテナーはふだん 3 日以内に返信
simonw/sqlite-utils の issue をすべて見る
似ている issue
-
community enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
Hochfrequenz/sapgui.mcp#1039 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
didi/helixharness#18 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
dataforgoodfr/democracy-watch#46 · リアクション 1 件 ·