{"id":15433056,"url":"https://github.com/simonw/sqlite-fts5-trigram","last_synced_at":"2025-07-01T13:39:49.553Z","repository":{"id":66508245,"uuid":"296966739","full_name":"simonw/sqlite-fts5-trigram","owner":"simonw","description":"Trigram tokenizer module for SQLite FTS5","archived":false,"fork":false,"pushed_at":"2021-02-22T04:07:54.000Z","size":9,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-18T07:53:59.389Z","etag":null,"topics":["fts5","sqlite","trigram"],"latest_commit_sha":null,"homepage":"https://sqlite.org/forum/forumpost/ca90da691a?t=h","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-19T23:14:51.000Z","updated_at":"2024-10-14T03:25:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"af03d1a1-6e89-4f79-8e32-6b60f614ee84","html_url":"https://github.com/simonw/sqlite-fts5-trigram","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"158d3abebd98f2c03d402f47949034ea1874aa81"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fsqlite-fts5-trigram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fsqlite-fts5-trigram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fsqlite-fts5-trigram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonw%2Fsqlite-fts5-trigram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonw","download_url":"https://codeload.github.com/simonw/sqlite-fts5-trigram/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249753094,"owners_count":21320664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fts5","sqlite","trigram"],"created_at":"2024-10-01T18:31:07.173Z","updated_at":"2025-04-19T17:52:39.696Z","avatar_url":"https://github.com/simonw.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlite-fts5-trigram\n\nTrigram tokenizer module for SQLite FTS5\n\nCode by Dan Kennedy, shared on [this forum thread](https://sqlite.org/forum/forumpost/ca90da691a?t=h).\n\nSee also [my weeknotes](https://simonwillison.net/2020/Sep/26/weeknotes-software-carpentry-sqlite/) describing this repository.\n\n**This repository is now obsolete** because this shipped as a feature in December 2020 in [SQLite 3.34.0](https://www.sqlite.org/releaselog/3_34_0.html).\n\nExample usage:\n```\nPython 3.8.5 (default, Jul 21 2020, 10:48:26) \n[Clang 11.0.3 (clang-1103.0.32.62)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e import sqlite3\n\u003e\u003e\u003e c = sqlite3.connect(\":memory:\")\n\u003e\u003e\u003e c\n\u003csqlite3.Connection object at 0x107e137b0\u003e\n\u003e\u003e\u003e c.enable_load_extension(True)\n\u003e\u003e\u003e c.load_extension(\"ftstri.so\")\n\u003e\u003e\u003e c\n\u003csqlite3.Connection object at 0x107e137b0\u003e\n\u003e\u003e\u003e c.execute(\"CREATE VIRTUAL TABLE dict USING fts5(word, tokenize=tri);\")\n\u003csqlite3.Cursor object at 0x107e9f880\u003e\n\u003e\u003e\u003e c.execute('INSERT INTO dict values (\"simon\")')\n\u003csqlite3.Cursor object at 0x107e9f8f0\u003e\n\u003e\u003e\u003e c.execute('INSERT INTO dict values (\"cleo\")')\n\u003csqlite3.Cursor object at 0x107e9f880\u003e\n\u003e\u003e\u003e c.execute('INSERT INTO dict values (\"natalie\")')\n\u003csqlite3.Cursor object at 0x107e9f8f0\u003e\n\u003e\u003e\u003e c.execute('select * from dict(?)', ['simon']).fetchall()\n[('simon',)]\n\u003e\u003e\u003e c.execute('select * from dict(?)', ['sim']).fetchall()\n[('simon',)]\n\u003e\u003e\u003e c.execute('select * from dict(?)', ['imo']).fetchall()\n[('simon',)]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['sim']).fetchall()\n[('(sim)on',)]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['simon']).fetchall()\n[('(simon)',)]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['mon']).fetchall()\n[('si(mon)',)]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['cl']).fetchall()\n[]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['cleo']).fetchall()\n[('(cleo)',)]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['cle']).fetchall()\n[('(cle)o',)]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['cleop']).fetchall()\n[]\n\u003e\u003e\u003e c.execute(\"select highlight(dict, 0, '(', ')') from dict(?)\", ['nat']).fetchall()\n[('(nat)alie',)]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fsqlite-fts5-trigram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonw%2Fsqlite-fts5-trigram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonw%2Fsqlite-fts5-trigram/lists"}