pi-memory
pi-memory copied to clipboard
node:sqlite missing FTS5 support causes runtime failure in MemoryStore
Description
When using pi-memory in a standard Node.js environment, the library fails during initialization with the following error:
Warning: pi-memory: failed to open store: no such module: fts5
Environment
- OS: Windows 11
- Node.js: v22.14.0
- pi-memory: latest
- SQLite (node:sqlite): built-in (no FTS5)
Steps to Reproduce
- Install and use
pi-memory - Observe error during migration:
no such module: fts5
Fixed in 9861f2a.
The root cause is that node:sqlite on Node 22/23 is compiled without SQLITE_ENABLE_FTS5 — this is a known upstream issue (nodejs/node#56476) affecting all platforms.
The fix wraps FTS5 table creation in a try/catch and gracefully falls back to the existing substring-matching search when FTS5 isn't available. For typical memory store sizes (hundreds of entries), the fallback performs identically. FTS5 will still be used automatically on Node builds that include it.
No new dependencies required.