mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Queries with reserved words or characters according to the SQLite
FTS5 query language could cause errors.
Queries are now escaped like so:
dog cat => "dog" "cat"
7 lines
166 B
Python
7 lines
166 B
Python
from datasette import hookimpl
|
|
from datasette.utils import escape_fts
|
|
|
|
|
|
@hookimpl
|
|
def prepare_connection(conn):
|
|
conn.create_function("escape_fts", 1, escape_fts)
|