{"html_url": "https://github.com/simonw/sqlite-utils/issues/246#issuecomment-801816980", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/246", "id": 801816980, "node_id": "MDEyOklzc3VlQ29tbWVudDgwMTgxNjk4MA==", "user": {"value": 37962604, "label": "polyrand"}, "created_at": "2021-03-18T10:40:32Z", "updated_at": "2021-03-18T10:43:04Z", "author_association": "NONE", "body": "I have found a similar problem, but I only when using that type of query (with `*` for doing a prefix search). I'm also building something on top of FTS5/sqlite-utils, and the way I decided to handle it was creating a specific function for prefixes. According to [the docs](https://www2.sqlite.org/fts5.html#fts5_prefix_queries), the query can be done in this 2 ways:\r\n\r\n```sql\r\n... MATCH '\"one two thr\" * '\r\n... MATCH 'one + two + thr*'\r\n```\r\n\r\nI thought I could build a query like the first one using this function:\r\n\r\n```python\r\ndef prefix(query: str):\r\n return f'\"{query}\" *'\r\n```\r\n\r\nAnd then I use the output of that function as the query parameter for the standard `.search()` method in sqlite-utils.\r\n\r\nHowever, my use case is different because I'm the one \"deciding\" when to use a prefix search, not the end user. I also haven't done many tests, but maybe you found that useful. One thing I could think of is checking if the query has an `*` at the end, remove it and build the prefix query using the function above.\r\n\r\nThis is just for prefix queries, I think having the escaping function is still useful for other use cases.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 831751367, "label": "Escaping FTS search strings"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/242#issuecomment-787150276", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/242", "id": 787150276, "node_id": "MDEyOklzc3VlQ29tbWVudDc4NzE1MDI3Ng==", "user": {"value": 37962604, "label": "polyrand"}, "created_at": "2021-02-27T21:27:26Z", "updated_at": "2021-02-27T21:27:26Z", "author_association": "NONE", "body": "I had this resource by Seth Michael Larson saved https://github.com/sethmlarson/pycon-async-sync-poster I haven't had a look at it, but it may contain useful info.\r\n\r\nOn twitter, I mentioned passing an aiosqlite connection during the `Database` creation. I'm not 100% familiar with the `sqlite-utils` codebase, so I may be wrong here, but maybe decorating internal functions could be an option? Then they are awaited or not inside the decorator depending on how they are called.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 817989436, "label": "Async support"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/pull/224#issuecomment-765678057", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/224", "id": 765678057, "node_id": "MDEyOklzc3VlQ29tbWVudDc2NTY3ODA1Nw==", "user": {"value": 37962604, "label": "polyrand"}, "created_at": "2021-01-22T20:53:06Z", "updated_at": "2021-01-23T20:13:27Z", "author_association": "NONE", "body": "I'm using the FTS methods in sqlite-utils for this website: [drwn.io](https://drwn.io/). I wanted to get pagination to have some kind of infinite scrolling in the landing page, and I ended up using that.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 792297010, "label": "Add fts offset docs."}, "performed_via_github_app": null}