Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot .enable_fts() for columns with spaces in their names #90

Closed
simonw opened this issue Mar 2, 2020 · 0 comments
Closed

Cannot .enable_fts() for columns with spaces in their names #90

simonw opened this issue Mar 2, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@simonw
Copy link
Owner

simonw commented Mar 2, 2020

import sqlite_utils
db = sqlite_utils.Database(memory=True)                                 
db["test"].insert({"space in name": "hello"})                           
db["test"].enable_fts(["space in name"])                                
---------------------------------------------------------------------------
OperationalError                          Traceback (most recent call last)
<ipython-input-8-ce4b87dd1c7a> in <module>
----> 1 db['test'].enable_fts(["space in name"])

/usr/local/lib/python3.7/site-packages/sqlite_utils/db.py in enable_fts(self, columns, fts_version, create_triggers)
    755         )
    756         self.db.conn.executescript(sql)
--> 757         self.populate_fts(columns)
    758 
    759         if create_triggers:

/usr/local/lib/python3.7/site-packages/sqlite_utils/db.py in populate_fts(self, columns)
    787             table=self.name, columns=", ".join(columns)
    788         )
--> 789         self.db.conn.executescript(sql)
    790         return self
    791 

OperationalError: near "in": syntax error
@simonw simonw added the bug Something isn't working label Mar 2, 2020
@simonw simonw closed this as completed in 0c36feb Mar 2, 2020
simonw added a commit to simonw/datasette-configure-fts that referenced this issue Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant