💭 sqlite_utils Python library - sqlite-utils ============================================ !https://sqlite-utils.datasette.io/en/stable/python-api.html#full-text-search Date: August 20, 2023 sqlite_utils Python library - sqlite-utils sqlite-utils.datasette.io [1] sqlite-utils is primarily a cli tool for sqlite operations such as enabling full text search, and executing searches, but it also has a nice python api that is exposed and pretty straightforward to use. ``` python from sqlite_utils import Database db = Database("database.db") db["post"].enable_fts(["title", "message", "tags]) db["post"].search("water") ``` This returns a generator object that you can iterate over the row objects with. !!! note This post is a thought [2]. It's a short note that I make about someone else's content online #thoughts [3] References: [1]: https://sqlite-utils.datasette.io/en/stable/python-api.html#full-text-search [2]: /thoughts/ [3]: /tags/thoughts/