.enable_fts() now works with columns with spaces in them, closes #90

This commit is contained in:
Simon Willison 2020-03-01 22:10:43 -08:00
commit 0c36feb6ca
2 changed files with 15 additions and 1 deletions

View file

@ -785,7 +785,7 @@ class Table(Queryable):
INSERT INTO [{table}_fts] (rowid, {columns})
SELECT rowid, {columns} FROM [{table}];
""".format(
table=self.name, columns=", ".join(columns)
table=self.name, columns=", ".join("[{}]".format(c) for c in columns)
)
self.db.conn.executescript(sql)
return self