mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
Default to FTS5
This commit is contained in:
parent
34a5c0e1e8
commit
02862be04c
2 changed files with 6 additions and 6 deletions
|
|
@ -211,15 +211,15 @@ class Table:
|
|||
self.db.conn.commit()
|
||||
return self
|
||||
|
||||
def enable_fts(self, columns):
|
||||
def enable_fts(self, columns, fts_version="FTS5"):
|
||||
"Enables FTS on the specified columns"
|
||||
sql = """
|
||||
CREATE VIRTUAL TABLE "{table}_fts" USING FTS4 (
|
||||
CREATE VIRTUAL TABLE "{table}_fts" USING {fts_version} (
|
||||
{columns},
|
||||
content="{table}"
|
||||
);
|
||||
""".format(
|
||||
table=self.name, columns=", ".join(columns)
|
||||
table=self.name, columns=", ".join(columns), fts_version=fts_version
|
||||
)
|
||||
self.db.conn.executescript(sql)
|
||||
self.populate_fts(columns)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue