mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-18 14:34:24 +02:00
Escape the table name in populate_fts and search.
This commit is contained in:
parent
cb70f7d109
commit
83ca4c802f
1 changed files with 2 additions and 2 deletions
|
|
@ -729,7 +729,7 @@ class Table(Queryable):
|
||||||
def populate_fts(self, columns):
|
def populate_fts(self, columns):
|
||||||
sql = """
|
sql = """
|
||||||
INSERT INTO "{table}_fts" (rowid, {columns})
|
INSERT INTO "{table}_fts" (rowid, {columns})
|
||||||
SELECT rowid, {columns} FROM {table};
|
SELECT rowid, {columns} FROM "{table}";
|
||||||
""".format(
|
""".format(
|
||||||
table=self.name, columns=", ".join(columns)
|
table=self.name, columns=", ".join(columns)
|
||||||
)
|
)
|
||||||
|
|
@ -796,7 +796,7 @@ class Table(Queryable):
|
||||||
|
|
||||||
def search(self, q):
|
def search(self, q):
|
||||||
sql = """
|
sql = """
|
||||||
select * from {table} where rowid in (
|
select * from "{table}" where rowid in (
|
||||||
select rowid from [{table}_fts]
|
select rowid from [{table}_fts]
|
||||||
where [{table}_fts] match :search
|
where [{table}_fts] match :search
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue