issues: 556814876
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
556814876 | MDU6SXNzdWU1NTY4MTQ4NzY= | 662 | Escape_fts5_query-hookimplementation does not work with queries to standard tables | 2181410 | closed | 0 | 5 | 2020-01-29T11:56:03Z | 2020-01-30T00:30:20Z | 2020-01-30T00:30:19Z | NONE | Hi Simon Thank you for adding the escape_function, but it does not work on my datasette-installation (0.33). I've added the following file to my datasette-dir: /plugins/sql_functions.py: `from datasette import hookimpl def escape_fts_query(query): bits = query.split() return ' '.join('"{}"'.format(bit.replace('"', '')) for bit in bits) @hookimpl def prepare_connection(conn): conn.create_function("escape_fts_query", 1, escape_fts_query)` It has no effect on the standard queries to the tables though, as they still produce errors when including any characters like '-', '/', '+' or '?' Does the function only work when using costum queries, where I can include the escape_fts-function explicitly in the sql-query? PS. I'm calling datasette with --plugins=plugins, and my other plugins work just fine. PPS. The fts5 virtual table is created with 'sqlite3' like so:
Thanks! Originally posted by @clausjuhl in https://github.com/simonw/datasette/issues/651#issuecomment-579675357 |
107914493 | issue | { "url": "https://api.github.com/repos/simonw/datasette/issues/662/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed |