mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-10-24 02:07:08 +02:00
enable_fts(): materialize columns so a one-shot iterator works
This commit is contained in:
parent
9c66bafa52
commit
d978a391ac
2 changed files with 16 additions and 0 deletions
|
|
@ -3770,6 +3770,9 @@ class Table(Queryable):
|
|||
:param tokenize: Custom SQLite tokenizer to use, for example ``"porter"`` to enable Porter stemming.
|
||||
:param replace: Should any existing FTS index for this table be replaced by the new one?
|
||||
"""
|
||||
# columns is used several times below, so a one-shot iterator
|
||||
# would be exhausted after the CREATE VIRTUAL TABLE statement
|
||||
columns = list(columns)
|
||||
create_fts_sql = (
|
||||
textwrap.dedent("""
|
||||
CREATE VIRTUAL TABLE {table_fts} USING {fts_version} (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue